Closed scgilardi closed 10 years ago
Instead of with-cause
how about introducing a rethrow+
form with the following arities ([cause] [cause object] [cause object message] [cause object fmt & args])
?
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+.
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.