pub struct ErrorEnvelope {
pub code: String,
pub message: String,
pub details: Option<Value>,
}Expand description
Error response body.
The inner part of the API error envelope:
{ "error": { "code": "...", "message": "...", "details": { ... } } }.
details carries error-specific structured context (for example the run
holding a conflicting idempotency key). It is omitted from the JSON output
when absent.
§Examples
use ironflow_types::ErrorEnvelope;
let json = r#"{"code": "RUN_NOT_FOUND", "message": "run not found"}"#;
let err: ErrorEnvelope = serde_json::from_str(json).unwrap();
assert_eq!(err.code, "RUN_NOT_FOUND");
assert!(err.details.is_none());Fields§
§code: StringMachine-readable error code (e.g., RUN_NOT_FOUND).
message: StringHuman-readable error message.
details: Option<Value>Optional structured context attached to the error.
Trait Implementations§
Source§impl Clone for ErrorEnvelope
impl Clone for ErrorEnvelope
Source§fn clone(&self) -> ErrorEnvelope
fn clone(&self) -> ErrorEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorEnvelope
impl Debug for ErrorEnvelope
Source§impl<'de> Deserialize<'de> for ErrorEnvelope
impl<'de> Deserialize<'de> for ErrorEnvelope
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ErrorEnvelope
impl Serialize for ErrorEnvelope
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorEnvelope
impl RefUnwindSafe for ErrorEnvelope
impl Send for ErrorEnvelope
impl Sync for ErrorEnvelope
impl Unpin for ErrorEnvelope
impl UnsafeUnpin for ErrorEnvelope
impl UnwindSafe for ErrorEnvelope
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