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.
| 16 | * exception classes. |
| 17 | */ |
| 18 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected