Skip to main content

ServiceError

Type Alias ServiceError 

Source
pub type ServiceError = ToolError;
Expand description

Alias for ToolError used where the error is framed as a service error.

Aliased Type§

pub struct ServiceError {
    pub schema_version: u8,
    pub kind: ServiceErrorKind,
    pub code: String,
    pub message: String,
    pub retryable: bool,
    pub remediation: String,
    pub field: Option<String>,
    pub bad_value: Option<String>,
    pub expected_pattern: Option<String>,
    pub reason_kind: Option<String>,
    pub available_actions: Vec<&'static str>,
}

Fields§

§schema_version: u8

Version of the error payload schema.

§kind: ServiceErrorKind

High-level failure category.

§code: String

Stable machine-readable error code.

§message: String

Human-readable error message.

§retryable: bool

Whether the caller may retry the operation.

§remediation: String

Actionable guidance for resolving the error.

§field: Option<String>

Offending input field, when the error is field-specific.

§bad_value: Option<String>

The rejected value, when a specific value caused the failure.

§expected_pattern: Option<String>

Expected pattern the input should have matched.

§reason_kind: Option<String>

Sub-classification of an execution failure (the underlying kind).

§available_actions: Vec<&'static str>

Valid action names to suggest to the caller.