Details
-
Type:
Enhancement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
equivalent of http://dev.clojure.org/jira/browse/CLJ-733
as per https://groups.google.com/d/topic/clojure/vlTR_161WNc/discussion
see also:
The attached patch introduces ex-info, ex-data and ExceptionInfo to cljs.core. ExceptionInfo has its prototype set to Error.prototype (apparently necessary for good behaviour across browsers; this is marked as a special case in a comment).
The version of ex-info introduced by the patch does support a cause argument, but I have to say that it's not clear to me how user code should go about extracting it. Direct property access feels icky; a new fn would be possible, but should perhaps be shared with Clojure; Clojure code would say (.getCause ex), but hanging a method on ExceptionInfo somehow feels icky to me too. My first cut at the patch actually did not include the cause field in ExceptionInfo and the ternary variant of ex-info; that could actually be a reasonable approach for now, especially if introducing a new fn might be a possibility (since that would presumably require coordination with Clojure).