private static JsonRpcError ReadError(JToken token) { if (token == null) { throw new ArgumentNullException(nameof(token)); } var errorCode = new JsonRpcErrorCode { Code = (int)token["code"], Message = (string)token["message"], }; var data = (string)token["data"]; return(new JsonRpcError(errorCode, data)); }
/// <summary> /// The error codes from and including -32768 to -32000 are reserved for pre-defined errors. /// Any code within this range, but not defined explicitly below is reserved for future use. /// -32000 to -32099 (Server error) are reserved for implementation-defined server-errors. /// </summary> public JsonRpcError(JsonRpcErrorCode errorCode, object data = null) { Code = errorCode.Code; Message = errorCode.Message; Data = data?.ToString(); }
public JsonRpcException(JsonRpcErrorCode errorCode, Exception innerException) : base(errorCode.Message, innerException) { Error = new JsonRpcError(errorCode, innerException); }
public JsonRpcException(JsonRpcErrorCode errorCode) : base(errorCode.Message) { Error = new JsonRpcError(errorCode); }