Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks should be able to control how exceptions are shown #486

Closed
Deraen opened this issue Jul 30, 2016 · 0 comments
Closed

Tasks should be able to control how exceptions are shown #486

Deraen opened this issue Jul 30, 2016 · 0 comments
Assignees

Comments

@Deraen
Copy link
Contributor

Deraen commented Jul 30, 2016

In several cases, such as Cljs compilation or test running, for example the stack trace might not be very interesting and is on the way of the interesting message. In these cases the tasks should be able to better decide how to display these exceptions.

Currently tasks need to throw the exception so that Boot detects that the task did not finish and that the next tasks should not be run.

I propose following solution:

Tasks send a special exception using ex-info, e.g. with :type :boot-exception or something, with some option keys on what to do, e.g. :boot-display-exception? false and optionally the original exception as cause. The default would be to just print the cause.

This could be implemented in boot.util/print-ex which is called at least by watch task: https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/util.clj#L253.

Or maybe this logic should be separated to another function, in case the options will in future control other things besides printting the exception. E.g. if the next tasks should run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants