pub enum Error {
Io(Error),
Network(Error),
Yaml(Error),
Json(Error),
Toml(Error),
Internal {
kind: ErrorKind,
message: Cow<'static, str>,
context: Option<ErrorContext>,
},
Anyhow(Error),
}Variants§
Implementations§
Source§impl Error
impl Error
Sourcepub fn with_context(self, context: &str) -> Self
pub fn with_context(self, context: &str) -> Self
Add context to an error for better user messaging
Sourcepub fn with_operation_context(self, operation: &str, api: &str) -> Self
pub fn with_operation_context(self, operation: &str, api: &str) -> Self
Add operation context to an error for better debugging
Sourcepub fn with_suggestion(self, suggestion: &str) -> Self
pub fn with_suggestion(self, suggestion: &str) -> Self
Add suggestions to error messages for better user guidance
Source§impl Error
impl Error
Sourcepub fn spec_not_found(name: impl Into<String>) -> Self
pub fn spec_not_found(name: impl Into<String>) -> Self
Create a specification not found error
Sourcepub fn spec_already_exists(name: impl Into<String>) -> Self
pub fn spec_already_exists(name: impl Into<String>) -> Self
Create a specification already exists error
Sourcepub fn cache_stale(name: impl Into<String>) -> Self
pub fn cache_stale(name: impl Into<String>) -> Self
Create a cache stale error when the spec file has been modified since caching
Sourcepub fn cached_spec_not_found(name: impl Into<String>) -> Self
pub fn cached_spec_not_found(name: impl Into<String>) -> Self
Create a cached spec not found error
Sourcepub fn cached_spec_corrupted(
name: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn cached_spec_corrupted( name: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a cached spec corrupted error
Sourcepub fn cache_version_mismatch(
name: impl Into<String>,
found: u32,
expected: u32,
) -> Self
pub fn cache_version_mismatch( name: impl Into<String>, found: u32, expected: u32, ) -> Self
Create a cache version mismatch error
Sourcepub fn secret_not_set(
scheme_name: impl Into<String>,
env_var: impl Into<String>,
) -> Self
pub fn secret_not_set( scheme_name: impl Into<String>, env_var: impl Into<String>, ) -> Self
Create a secret not set error
Sourcepub fn unsupported_auth_scheme(scheme: impl Into<String>) -> Self
pub fn unsupported_auth_scheme(scheme: impl Into<String>) -> Self
Create an unsupported auth scheme error
Sourcepub fn unsupported_security_scheme(scheme_type: impl Into<String>) -> Self
pub fn unsupported_security_scheme(scheme_type: impl Into<String>) -> Self
Create an unsupported security scheme error
Sourcepub fn validation_error(message: impl Into<String>) -> Self
pub fn validation_error(message: impl Into<String>) -> Self
Create a generic validation error
Sourcepub fn invalid_config(reason: impl Into<String>) -> Self
pub fn invalid_config(reason: impl Into<String>) -> Self
Create an invalid configuration error
Sourcepub fn invalid_json_body(reason: impl Into<String>) -> Self
pub fn invalid_json_body(reason: impl Into<String>) -> Self
Create an invalid JSON body error
Sourcepub fn invalid_path(path: impl Into<String>, reason: impl Into<String>) -> Self
pub fn invalid_path(path: impl Into<String>, reason: impl Into<String>) -> Self
Create an invalid path error
Sourcepub fn request_failed(status: StatusCode, reason: impl Into<String>) -> Self
pub fn request_failed(status: StatusCode, reason: impl Into<String>) -> Self
Create a request failed error
Sourcepub fn response_read_error(reason: impl Into<String>) -> Self
pub fn response_read_error(reason: impl Into<String>) -> Self
Create a response read error
Sourcepub fn invalid_http_method(method: impl Into<String>) -> Self
pub fn invalid_http_method(method: impl Into<String>) -> Self
Create an invalid HTTP method error
Sourcepub fn invalid_header_name(
name: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_header_name( name: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid header name error
Sourcepub fn invalid_header_value(
name: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_header_value( name: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid header value error
Sourcepub fn invalid_header_format(header: impl Into<String>) -> Self
pub fn invalid_header_format(header: impl Into<String>) -> Self
Create an invalid header format error
Sourcepub const fn empty_header_name() -> Self
pub const fn empty_header_name() -> Self
Create an empty header name error
Sourcepub fn interactive_input_too_long(max_length: usize) -> Self
pub fn interactive_input_too_long(max_length: usize) -> Self
Create an interactive input too long error
Sourcepub fn interactive_invalid_characters(
invalid_chars: impl Into<String>,
suggestion: impl Into<String>,
) -> Self
pub fn interactive_invalid_characters( invalid_chars: impl Into<String>, suggestion: impl Into<String>, ) -> Self
Create an interactive invalid characters error
Sourcepub const fn interactive_timeout() -> Self
pub const fn interactive_timeout() -> Self
Create an interactive timeout error
Sourcepub fn interactive_retries_exhausted(
max_retries: usize,
last_error: impl Into<String>,
suggestions: &[String],
) -> Self
pub fn interactive_retries_exhausted( max_retries: usize, last_error: impl Into<String>, suggestions: &[String], ) -> Self
Create an interactive retries exhausted error
Sourcepub fn missing_server_variable(name: impl Into<String>) -> Self
pub fn missing_server_variable(name: impl Into<String>) -> Self
Create a missing server variable error
Sourcepub fn unknown_server_variable(
name: impl Into<String>,
available: &[String],
) -> Self
pub fn unknown_server_variable( name: impl Into<String>, available: &[String], ) -> Self
Create an unknown server variable error
Sourcepub fn unresolved_template_variable(
name: impl Into<String>,
url: impl Into<String>,
) -> Self
pub fn unresolved_template_variable( name: impl Into<String>, url: impl Into<String>, ) -> Self
Create an unresolved template variable error
Sourcepub fn invalid_environment_variable_name(
name: impl Into<String>,
reason: impl Into<String>,
suggestion: impl Into<String>,
) -> Self
pub fn invalid_environment_variable_name( name: impl Into<String>, reason: impl Into<String>, suggestion: impl Into<String>, ) -> Self
Create an invalid environment variable name error with suggestion
Sourcepub fn invalid_server_var_format(
arg: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_server_var_format( arg: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid server variable format error
Sourcepub fn invalid_server_var_value(
name: impl Into<String>,
value: impl Into<String>,
allowed_values: &[String],
) -> Self
pub fn invalid_server_var_value( name: impl Into<String>, value: impl Into<String>, allowed_values: &[String], ) -> Self
Create an invalid server variable value error
Sourcepub fn operation_not_found(operation: impl Into<String>) -> Self
pub fn operation_not_found(operation: impl Into<String>) -> Self
Create an operation not found error
Sourcepub fn operation_not_found_with_suggestions(
operation: impl Into<String>,
suggestions: &[String],
) -> Self
pub fn operation_not_found_with_suggestions( operation: impl Into<String>, suggestions: &[String], ) -> Self
Create an operation not found error with suggestions
Sourcepub fn network_request_failed(reason: impl Into<String>) -> Self
pub fn network_request_failed(reason: impl Into<String>) -> Self
Create a network request failed error
Sourcepub fn serialization_error(reason: impl Into<String>) -> Self
pub fn serialization_error(reason: impl Into<String>) -> Self
Create a serialization error
Sourcepub fn home_directory_not_found() -> Self
pub fn home_directory_not_found() -> Self
Create a home directory not found error
Sourcepub fn invalid_command(
context: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_command( context: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid command error
Sourcepub fn http_error_with_context(
status: u16,
body: impl Into<String>,
api_name: impl Into<String>,
operation_id: Option<impl Into<String>>,
security_schemes: &[String],
) -> Self
pub fn http_error_with_context( status: u16, body: impl Into<String>, api_name: impl Into<String>, operation_id: Option<impl Into<String>>, security_schemes: &[String], ) -> Self
Create an HTTP error with context
Sourcepub fn jq_filter_error(
filter: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn jq_filter_error( filter: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a JQ filter error
Sourcepub fn transient_network_error(
reason: impl Into<String>,
retryable: bool,
) -> Self
pub fn transient_network_error( reason: impl Into<String>, retryable: bool, ) -> Self
Create a transient network error
Sourcepub fn retry_limit_exceeded(
max_attempts: u32,
last_error: impl Into<String>,
) -> Self
pub fn retry_limit_exceeded( max_attempts: u32, last_error: impl Into<String>, ) -> Self
Create a retry limit exceeded error
Sourcepub fn retry_limit_exceeded_detailed(
max_attempts: u32,
attempts_made: u32,
last_error: impl Into<String>,
initial_delay_ms: u64,
max_delay_ms: u64,
last_status_code: Option<u16>,
operation_id: impl Into<String>,
) -> Self
pub fn retry_limit_exceeded_detailed( max_attempts: u32, attempts_made: u32, last_error: impl Into<String>, initial_delay_ms: u64, max_delay_ms: u64, last_status_code: Option<u16>, operation_id: impl Into<String>, ) -> Self
Create a retry limit exceeded error with detailed retry information
Sourcepub fn request_timeout(timeout_seconds: u64) -> Self
pub fn request_timeout(timeout_seconds: u64) -> Self
Create a request timeout error
Sourcepub fn missing_path_parameter(name: impl Into<String>) -> Self
pub fn missing_path_parameter(name: impl Into<String>) -> Self
Create a missing path parameter error
Sourcepub const fn invalid_idempotency_key() -> Self
pub const fn invalid_idempotency_key() -> Self
Create an invalid idempotency key error
Sourcepub const fn editor_not_set() -> Self
pub const fn editor_not_set() -> Self
Create an editor not set error
Sourcepub fn editor_failed(name: impl Into<String>) -> Self
pub fn editor_failed(name: impl Into<String>) -> Self
Create an editor failed error
Sourcepub fn invalid_api_context_name(
name: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_api_context_name( name: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an invalid API context name error
Sourcepub fn unknown_setting_key(key: impl Into<String>) -> Self
pub fn unknown_setting_key(key: impl Into<String>) -> Self
Create an unknown setting key error
Sourcepub fn invalid_setting_value(key: SettingKey, value: impl Into<String>) -> Self
pub fn invalid_setting_value(key: SettingKey, value: impl Into<String>) -> Self
Create an invalid setting value error
Sourcepub fn setting_value_out_of_range(
key: SettingKey,
value: impl Into<String>,
reason: &str,
) -> Self
pub fn setting_value_out_of_range( key: SettingKey, value: impl Into<String>, reason: &str, ) -> Self
Create a setting value out of range error
Sourcepub fn batch_cycle_detected(cycle: &[String]) -> Self
pub fn batch_cycle_detected(cycle: &[String]) -> Self
Create a batch dependency cycle detected error
Sourcepub fn batch_missing_dependency(
operation_id: impl Into<String>,
missing_dep: impl Into<String>,
) -> Self
pub fn batch_missing_dependency( operation_id: impl Into<String>, missing_dep: impl Into<String>, ) -> Self
Create a batch missing dependency reference error
Sourcepub fn batch_undefined_variable(
operation_id: impl Into<String>,
variable: impl Into<String>,
) -> Self
pub fn batch_undefined_variable( operation_id: impl Into<String>, variable: impl Into<String>, ) -> Self
Create a batch undefined variable error
Sourcepub fn batch_capture_failed(
operation_id: impl Into<String>,
variable: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn batch_capture_failed( operation_id: impl Into<String>, variable: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a batch capture failed error
Sourcepub fn batch_missing_id(context: impl Into<String>) -> Self
pub fn batch_missing_id(context: impl Into<String>) -> Self
Create a batch operation missing id error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.