pub struct ApiError {
pub status: u16,
pub code: Option<String>,
pub message: String,
pub request_id: Option<String>,
pub retry_after: Option<Duration>,
pub headers: HeaderMap,
pub raw_body: Bytes,
}Expand description
Structured WorkOS API error response. Populated for every non-2xx response.
Fields§
§status: u16HTTP status code.
code: Option<String>WorkOS error code (parsed from code or error JSON fields when present).
message: StringHuman-readable error message (parsed from message / error_description,
otherwise the raw response body).
request_id: Option<String>x-request-id response header, if the server emitted one. Always
include this when reporting bugs to WorkOS.
retry_after: Option<Duration>Retry-After interval parsed from the response, when present. For
429 and 503 responses servers commonly populate this.
headers: HeaderMapAll response headers, for advanced debugging or custom error mapping.
raw_body: BytesRaw response body bytes — preserved verbatim so callers can inspect non-standard error shapes.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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