pub enum ServerFnError {
ServerError {
message: String,
code: u16,
details: Option<Value>,
},
Request(RequestError),
StreamError(String),
Registration(String),
UnsupportedRequestMethod(String),
MiddlewareError(String),
Deserialization(String),
Serialization(String),
Args(String),
MissingArg(String),
Response(String),
}Expand description
The error type for the server function system. This enum encompasses all possible errors that can occur during the registration, invocation, and processing of server functions.
Variants§
ServerError
Occurs when there is an error while actually running the function on the server.
The details field can optionally contain additional structured information about the error.
When passing typed errors from the server to the client, the details field contains the serialized
representation of the error.
Fields
Request(RequestError)
Occurs on the client if there is a network error while trying to run function on server.
StreamError(String)
Occurs on the client if there is an error while trying to read the response body as a stream.
Registration(String)
Error while trying to register the server function (only occurs in case of poisoned RwLock).
UnsupportedRequestMethod(String)
Occurs on the client if trying to use an unsupported HTTP method when building a request.
MiddlewareError(String)
Occurs when there is an error while actually running the middleware on the server.
Deserialization(String)
Occurs on the client if there is an error deserializing the server’s response.
Serialization(String)
Occurs on the client if there is an error serializing the server function arguments.
Args(String)
Occurs on the server if there is an error deserializing one of the arguments that’s been sent.
MissingArg(String)
Occurs on the server if there’s a missing argument.
Response(String)
Occurs on the server if there is an error creating an HTTP response.
Implementations§
Source§impl ServerFnError
impl ServerFnError
Trait Implementations§
Source§impl Clone for ServerFnError
impl Clone for ServerFnError
Source§fn clone(&self) -> ServerFnError
fn clone(&self) -> ServerFnError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more