#[non_exhaustive]pub enum Error {
Body {
status: StatusCode,
message: String,
},
ContentType {
found: String,
},
Decode(Error),
EmptyBody,
NotAcceptable {
accept: String,
},
}Expand description
A request this endpoint refused, before any events were produced.
Implements [IntoResponse], so it doubles as the rejection type of
AgUiInput — a handler can take
Result<AgUiInput, Error> and inspect the failure, or take AgUiInput and
let axum answer with the response below.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Body
The request body could not be read at all — a connection that died
mid-body, or a payload over the configured
DefaultBodyLimit.
Carries the status axum’s own extractor chose, so a body limit stays a
413 rather than being flattened into a 400.
ContentType
The Content-Type was set to something that is not JSON.
An absent header is accepted — curl -d and hand-written clients often
omit it. A wrong one is refused rather than sniffed, which also means
a cross-origin HTML form (whose content type is always one of three
non-JSON values it cannot override) can never reach an agent.
Decode(Error)
The body was JSON, but not a
RunAgentInput.
The message is serde’s, so it names the field and the offset.
EmptyBody
The request body was empty.
NotAcceptable
Content negotiation found nothing this build can emit.
See negotiate.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
use the Display impl or to_string()