MCPcopy Index your code
hub / github.com/clojure/clojure / ExceptionInfo

Class ExceptionInfo

src/jvm/clojure/lang/ExceptionInfo.java:18–41  ·  view source on GitHub ↗

Exception that carries data (a map) as additional payload. Clojure programs that need richer semantics for exceptions should use this in lieu of defining project-specific exception classes.

Source from the content-addressed store, hash-verified

16 * exception classes.
17 */
18public class ExceptionInfo extends RuntimeException implements IExceptionInfo {
19
20 private static final long serialVersionUID = -1073473305916521986L;
21
22 public final IPersistentMap data;
23
24 public ExceptionInfo(String s, IPersistentMap data) {
25 this(s, data, null);
26 }
27
28 public ExceptionInfo(String s, IPersistentMap data, Throwable throwable) {
29 // null cause is equivalent to not passing a cause
30 super(s, throwable);
31 this.data = (data == null) ? PersistentArrayMap.EMPTY: data;
32 }
33
34 public IPersistentMap getData() {
35 return data;
36 }
37
38 public String toString() {
39 return "clojure.lang.ExceptionInfo: " + getMessage() + " " + data.toString();
40 }
41}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected