pub enum ObzError {
Provider {
code: ErrorCode,
message: String,
raw_error: Option<String>,
recoverable: bool,
suggestion: Option<String>,
doc_url: Option<String>,
},
Auth {
code: ErrorCode,
message: String,
recoverable: bool,
suggestion: Option<String>,
},
InvalidArgument {
code: ErrorCode,
message: String,
suggestion: Option<String>,
},
Network {
code: ErrorCode,
message: String,
recoverable: bool,
source_chain: Option<Vec<String>>,
},
Unsupported {
message: String,
provider: Option<String>,
suggestion: Option<String>,
},
}Expand description
The core error type for obz-core operations.
Uses thiserror for ergonomic error handling. Each variant carries
enough information to produce a structured ErrorDetail for the
response envelope.
Variants§
Provider
Provider returned an error.
Fields
Auth
Authentication error.
Fields
recoverable: boolWhether the caller can recover by retrying the same request.
Set true only when the underlying cause has already been
resolved (e.g. credential-process refreshed expired credentials).
All other auth errors should use false — downstream consumers
(AI Agents) may auto-retry based on this flag.
InvalidArgument
Invalid CLI arguments.
Fields
Network
Network error.
Fields
Unsupported
Operation not supported by this provider.
Implementations§
Source§impl ObzError
impl ObzError
Sourcepub fn to_error_detail(&self, provider: Option<&str>) -> ErrorDetail
pub fn to_error_detail(&self, provider: Option<&str>) -> ErrorDetail
Convert this error into a structured ErrorDetail for JSON output.
provider is injected into ErrorDetail.provider only when the
variant does not already carry one (e.g. [Unsupported] sets its
own provider, which takes precedence over the caller-supplied value).
Trait Implementations§
Source§impl Error for ObzError
impl Error for ObzError
1.30.0 · 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()