Provide more options for error reporting in clojure.main

Description

There are some potential improvements to be made in the new error reporting configuration in 1.10.1:

  • change setting from a flag to a set of enumerated values ("file" for temp file reporting, "stderr" for printing to stderr, and "none" for no reporting)

  • allow setting by Java system property (clojure.main.report) in addition to a command-line setting (with --report)

In particular on the last item, current invokers of clojure.main do not know about any new option we add, but do know how to pass a Java system property down. So, allowing setting by Java system property will make it possible for users behind tools like leiningen to control the error reporting without needing additional changes.

Proposed:

Allowed values:

  • file - write report to temp file

  • stderr - write report to stderr

  • none - don't report

Set via:

  • Java system property: -Dclojure.main.report=file

  • clojure.main command line option: --report file, overrides system property

  • Default to file, if not set in either above

Patch: clj-2504-2.patch

Environment

None

Attachments

2
  • 07 May 2019, 03:54 PM
  • 15 Apr 2019, 04:53 PM

Activity

Show:

Alex MillerMay 7, 2019 at 3:54 PM

Updated per screener's note to remove the exit flag. Also fixed bug (missing t) in final call to report-error.

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code

Priority

Affects versions

Fix versions

Created April 15, 2019 at 4:51 PM
Updated May 16, 2019 at 5:55 PM
Resolved May 16, 2019 at 5:55 PM

Flag notifications