Skip to content

Commit

Permalink
feat: too many requests error (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
heilhead authored Jun 16, 2023
1 parent 7b49fc4 commit 91b68f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions relay_rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ pub enum GenericError {
#[error("Authorization error: {0}")]
Authorization(BoxError),

#[error("Too many requests")]
TooManyRequests,

/// Request parameters validation failed.
#[error("Request validation error: {0}")]
Validation(#[from] ValidationError),
Expand Down Expand Up @@ -98,6 +101,7 @@ impl GenericError {
pub fn code(&self) -> i32 {
match self {
Self::Authorization(_) => 3000,
Self::TooManyRequests => 3001,
Self::Serialization(_) => -32700,
Self::Validation(_) => -32602,
Self::RequestMethod => -32601,
Expand Down

0 comments on commit 91b68f0

Please sign in to comment.