/** * Instantiates a new jSONRPC exception. * * @param code * the code * @param description * the description */ public JSONRPCException(final CODE code, final String description) { super(description); init(code, description, null); }
/** * Instantiates a new jSONRPC exception. * * @param code * the code */ public JSONRPCException(final CODE code) { super(); init(code, null, null); }
/** * Instantiates a new jSONRPC exception. * * @param message * the message */ public JSONRPCException(final String message) { super(message); init(CODE.UNKNOWN_ERROR, message, null); }
/** * Instantiates a new jSONRPC exception. */ public JSONRPCException() { super(); init(CODE.UNKNOWN_ERROR, null, null); }
/** * Instantiates a new jSONRPC exception. * * @param message * the message * @param t * the t */ public JSONRPCException(final String message, final Throwable t) { super(message, t); init(CODE.UNKNOWN_ERROR, message, t); }
/** * Instantiates a new jSONRPC exception. * * @param code * the code * @param description * the description * @param t * the t */ public JSONRPCException(final CODE code, final String description, final Throwable t) { super(description, t); init(code, description, t); }
/** * Instantiates a new jSONRPC exception. * * @param exception * the exception * @throws JsonProcessingException * the json processing exception */ public JSONRPCException(final JsonNode exception) throws JsonProcessingException { super(); JSONRPCException cause = null; if (exception != null && !exception.isNull()) { cause = JOM.getInstance().treeToValue(exception, JSONRPCException.class); cause.setRemote(true); if (exception.has("stackTrace")) { final TypeUtil<List<StackTraceElement>> injector = new TypeUtil<List<StackTraceElement>>() {}; final List<StackTraceElement> trace = injector.inject(exception .get("stackTrace")); cause.setStackTrace(trace.toArray(new StackTraceElement[0])); } } init(CODE.REMOTE_EXCEPTION, JSONRPCException.class.getSimpleName() + " received!", cause); }
/** * Instantiates a new jSONRPC exception. * * @param error * the error */ public JSONRPCException(final JSONRPCException error) { super(error); if (error != null) { setCode(error.getCode()); setMessage(error.getMessage()); if (error.hasData()) { setData(error.getData()); } } else { init(CODE.UNKNOWN_ERROR, null, null); } }