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

provide optional argument to throw+ to allow specifying the cause explicitly, addresses issue #29 #48

Merged
merged 5 commits into from Oct 18, 2014

Conversation

scgilardi
Copy link
Owner

previously the cause was automatically captured within a try+ catch
clause or nil otherwise.

This could also be accomplished by allowing more flexibility in the
throw+ arguments, but that's quite a bit more complicated to code.

previously the cause was automatically captured within a try+ catch
clause or nil otherwise.

This could also be accomplished by allowing more flexibility in the
throw+ arguments, but that's quite a bit more complicated to code.
@pjstadig
Copy link
Contributor

Instead of with-cause how about introducing a rethrow+ form with the following arities ([cause] [cause object] [cause object message] [cause object fmt & args])?

@scgilardi
Copy link
Owner Author

Looking over the docs at http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html , I think rethrow doesn't have quite the right connotation. It's more like consing something new onto the cause chain or "wrapping" which is already used a fair amount in slingshot docs for the relationship between the ExceptionInfo object and the context being thrown.

I took another shot at allowing an optional cause argument and I think the result is good.

(throw+ object cause? message-or-fmt? & fmt-args)

I like it better than with-cause or a separate rethrow+.

@scgilardi scgilardi changed the title provide with-cause to allow specifying the cause explicitly, addresses issue #29 provide optional argument to throw+ to allow specifying the cause explicitly, addresses issue #29 Oct 15, 2014
scgilardi added a commit that referenced this pull request Oct 18, 2014
provide optional argument to throw+ to allow specifying the cause explicitly, addresses issue #29
@scgilardi scgilardi merged commit 4e03d92 into master Oct 18, 2014
@scgilardi scgilardi deleted the allow-specifying-the-cause branch October 18, 2014 21:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants