pub enum ErrorBody {
Text(String),
Unauthorized(UnauthorizedError),
Detail(DetailError),
Message(MessageError),
Json(Value),
}Expand description
Structured error response body from the Letta API.
Variants§
Text(String)
Plain text error response.
Unauthorized error (401) with specific fields.
Detail(DetailError)
Error with detail field (validation errors, simple errors).
Message(MessageError)
Error with message field.
Json(Value)
Unstructured JSON error response (fallback).
Implementations§
Source§impl ErrorBody
impl ErrorBody
Sourcepub fn from_response(body: &str) -> Self
pub fn from_response(body: &str) -> Self
Parse an error body from a response string.
Sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Check if this is a validation error.
Trait Implementations§
impl StructuralPartialEq for ErrorBody
Auto Trait Implementations§
impl Freeze for ErrorBody
impl RefUnwindSafe for ErrorBody
impl Send for ErrorBody
impl Sync for ErrorBody
impl Unpin for ErrorBody
impl UnwindSafe for ErrorBody
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