pub enum GatewayError {
Show 22 variants
RateLimitExceeded {
message: String,
retry_after: Option<u64>,
},
AuthenticationFailed(String),
AuthorizationFailed(String),
InvalidApiKey,
TokenExpired,
InvalidToken(String),
JwtError(Error),
OAuth2Error(String),
GraphQLError(String),
WebSocketError(String),
InvalidRequest(String),
UnsupportedVersion {
version: String,
supported: Vec<String>,
},
TransformationError(String),
SchemaValidationError(String),
LoadBalancerError(String),
BackendUnavailable(String),
CircuitBreakerOpen(String),
Timeout(String),
SerializationError(Error),
HttpError(String),
InternalError(String),
ConfigError(String),
}Expand description
Comprehensive error types for API gateway operations.
Variants§
RateLimitExceeded
Rate limit exceeded error.
AuthenticationFailed(String)
Authentication error.
AuthorizationFailed(String)
Authorization error.
InvalidApiKey
Invalid API key error.
TokenExpired
Expired token error.
InvalidToken(String)
Invalid token error.
JwtError(Error)
JWT error.
OAuth2Error(String)
OAuth2 error.
GraphQLError(String)
GraphQL error.
WebSocketError(String)
WebSocket error.
InvalidRequest(String)
Invalid request error.
UnsupportedVersion
Unsupported API version error.
TransformationError(String)
Transformation error.
SchemaValidationError(String)
Schema validation error.
LoadBalancerError(String)
Load balancer error.
Backend unavailable error.
CircuitBreakerOpen(String)
Circuit breaker open error.
Timeout(String)
Timeout error.
SerializationError(Error)
Serialization error.
HttpError(String)
HTTP error.
InternalError(String)
Internal server error.
ConfigError(String)
Configuration error.
Implementations§
Source§impl GatewayError
impl GatewayError
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Returns HTTP status code for this error.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns whether this error is retryable.
Sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
Returns retry-after duration in seconds if applicable.
Sourcepub fn to_json_response(&self) -> Value
pub fn to_json_response(&self) -> Value
Converts error to JSON error response.
Sourcepub fn error_code(&self) -> &str
pub fn error_code(&self) -> &str
Returns error code string.
Trait Implementations§
Source§impl Debug for GatewayError
impl Debug for GatewayError
Source§impl Display for GatewayError
impl Display for GatewayError
Source§impl Error for GatewayError
impl Error for GatewayError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for GatewayError
impl From<Error> for GatewayError
Source§impl From<Error> for GatewayError
impl From<Error> for GatewayError
Source§impl From<GatewayError> for StatusCode
impl From<GatewayError> for StatusCode
Source§fn from(error: GatewayError) -> Self
fn from(error: GatewayError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for GatewayError
impl !RefUnwindSafe for GatewayError
impl Send for GatewayError
impl Sync for GatewayError
impl Unpin for GatewayError
impl UnsafeUnpin for GatewayError
impl !UnwindSafe for GatewayError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more