Skip to content

Commit 91b68f0

Browse files
authored
feat: too many requests error (#29)
1 parent 7b49fc4 commit 91b68f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

relay_rpc/src/rpc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ pub enum GenericError {
6868
#[error("Authorization error: {0}")]
6969
Authorization(BoxError),
7070

71+
#[error("Too many requests")]
72+
TooManyRequests,
73+
7174
/// Request parameters validation failed.
7275
#[error("Request validation error: {0}")]
7376
Validation(#[from] ValidationError),
@@ -98,6 +101,7 @@ impl GenericError {
98101
pub fn code(&self) -> i32 {
99102
match self {
100103
Self::Authorization(_) => 3000,
104+
Self::TooManyRequests => 3001,
101105
Self::Serialization(_) => -32700,
102106
Self::Validation(_) => -32602,
103107
Self::RequestMethod => -32601,

0 commit comments

Comments
 (0)