pub enum GatewayError {
Client(ClientError),
Provider(ProviderError),
Auth {
message: String,
},
InvalidRequest {
message: String,
},
RateLimit {
message: String,
},
ContentFiltered {
message: String,
},
Internal {
message: String,
},
ServiceUnavailable,
Config {
message: String,
},
Serialization(Error),
Cache {
message: String,
},
Plugin {
message: String,
},
}
Expand description
Comprehensive error types for the Ultrafast Gateway.
This enum defines all possible error types that can occur in the gateway, including client errors, provider errors, and internal gateway errors. Each error variant includes appropriate error messages and can be automatically converted to HTTP responses.
Variants§
Client(ClientError)
Errors originating from the client SDK
Provider(ProviderError)
Errors from AI/LLM providers
Auth
Gateway authentication and authorization errors
InvalidRequest
Invalid or malformed request errors
RateLimit
Rate limiting and quota violation errors
ContentFiltered
Content filtering and moderation errors
Internal
Internal gateway server errors
Service unavailability errors
Config
Configuration and setup errors
Serialization(Error)
JSON serialization and deserialization errors
Cache
Cache operation errors
Plugin
Plugin execution and management errors
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<ClientError> for GatewayError
impl From<ClientError> for GatewayError
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Source§impl From<Error> for GatewayError
impl From<Error> for GatewayError
Source§impl From<ProviderError> for GatewayError
impl From<ProviderError> for GatewayError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Source§impl IntoResponse for GatewayError
impl IntoResponse for GatewayError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl Freeze for GatewayError
impl !RefUnwindSafe for GatewayError
impl Send for GatewayError
impl Sync for GatewayError
impl Unpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.