File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ pub enum ValidationError {
5050/// make sense of the problem.
5151#[ derive( Debug , thiserror:: Error ) ]
5252pub enum GenericError {
53+ #[ error( "Authorization error: {0}" ) ]
54+ Authorization ( BoxError ) ,
55+
5356 /// Request parameters validation failed.
5457 #[ error( "Request validation error: {0}" ) ]
5558 Validation ( #[ from] ValidationError ) ,
@@ -74,11 +77,12 @@ pub enum GenericError {
7477}
7578
7679impl GenericError {
77- /// The error code. These are mostly generic and carried over from the old
78- /// `ts-relay`.
80+ /// The error code. These are the standard JSONRPC error codes. The Relay
81+ /// specific errors are in 3000-4999 range to align with the websocket close
82+ /// codes.
7983 pub fn code ( & self ) -> i32 {
80- // Source: https://github.com/WalletConnect/rs-relay/issues/262
8184 match self {
85+ Self :: Authorization ( _) => 3000 ,
8286 Self :: Serialization ( _) => -32700 ,
8387 Self :: Validation ( _) => -32602 ,
8488 Self :: RequestMethod => -32601 ,
You can’t perform that action at this time.
0 commit comments