Skip to main content

Error

Enum Error 

Source
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§

§

Io(Error)

§

Network(Error)

§

Yaml(Error)

§

Json(Error)

§

Toml(Error)

§

Internal

Fields

§message: Cow<'static, str>
§

Anyhow(Error)

Implementations§

Source§

impl Error

Source

pub fn with_context(self, context: &str) -> Self

Add context to an error for better user messaging

Source

pub fn with_operation_context(self, operation: &str, api: &str) -> Self

Add operation context to an error for better debugging

Source

pub fn with_suggestion(self, suggestion: &str) -> Self

Add suggestions to error messages for better user guidance

Source

pub fn to_json(&self) -> JsonError

Convert error to JSON representation for structured output

Source§

impl Error

Source

pub fn spec_not_found(name: impl Into<String>) -> Self

Create a specification not found error

Source

pub fn spec_already_exists(name: impl Into<String>) -> Self

Create a specification already exists error

Source

pub fn cached_spec_not_found(name: impl Into<String>) -> Self

Create a cached spec not found error

Source

pub fn cached_spec_corrupted( name: impl Into<String>, reason: impl Into<String>, ) -> Self

Create a cached spec corrupted error

Source

pub fn cache_version_mismatch( name: impl Into<String>, found: u32, expected: u32, ) -> Self

Create a cache version mismatch error

Source

pub fn secret_not_set( scheme_name: impl Into<String>, env_var: impl Into<String>, ) -> Self

Create a secret not set error

Source

pub fn unsupported_auth_scheme(scheme: impl Into<String>) -> Self

Create an unsupported auth scheme error

Source

pub fn unsupported_security_scheme(scheme_type: impl Into<String>) -> Self

Create an unsupported security scheme error

Source

pub fn validation_error(message: impl Into<String>) -> Self

Create a generic validation error

Source

pub fn invalid_config(reason: impl Into<String>) -> Self

Create an invalid configuration error

Source

pub fn invalid_json_body(reason: impl Into<String>) -> Self

Create an invalid JSON body error

Source

pub fn invalid_path(path: impl Into<String>, reason: impl Into<String>) -> Self

Create an invalid path error

Source

pub fn request_failed(status: StatusCode, reason: impl Into<String>) -> Self

Create a request failed error

Source

pub fn response_read_error(reason: impl Into<String>) -> Self

Create a response read error

Source

pub fn invalid_http_method(method: impl Into<String>) -> Self

Create an invalid HTTP method error

Source

pub fn invalid_header_name( name: impl Into<String>, reason: impl Into<String>, ) -> Self

Create an invalid header name error

Source

pub fn invalid_header_value( name: impl Into<String>, reason: impl Into<String>, ) -> Self

Create an invalid header value error

Source

pub fn invalid_header_format(header: impl Into<String>) -> Self

Create an invalid header format error

Source

pub const fn empty_header_name() -> Self

Create an empty header name error

Source

pub fn interactive_input_too_long(max_length: usize) -> Self

Create an interactive input too long error

Source

pub fn interactive_invalid_characters( invalid_chars: impl Into<String>, suggestion: impl Into<String>, ) -> Self

Create an interactive invalid characters error

Source

pub const fn interactive_timeout() -> Self

Create an interactive timeout error

Source

pub fn interactive_retries_exhausted( max_retries: usize, last_error: impl Into<String>, suggestions: &[String], ) -> Self

Create an interactive retries exhausted error

Source

pub fn missing_server_variable(name: impl Into<String>) -> Self

Create a missing server variable error

Source

pub fn unknown_server_variable( name: impl Into<String>, available: &[String], ) -> Self

Create an unknown server variable error

Source

pub fn unresolved_template_variable( name: impl Into<String>, url: impl Into<String>, ) -> Self

Create an unresolved template variable error

Source

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

Source

pub fn invalid_server_var_format( arg: impl Into<String>, reason: impl Into<String>, ) -> Self

Create an invalid server variable format error

Source

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

Source

pub fn operation_not_found(operation: impl Into<String>) -> Self

Create an operation not found error

Source

pub fn operation_not_found_with_suggestions( operation: impl Into<String>, suggestions: &[String], ) -> Self

Create an operation not found error with suggestions

Source

pub fn network_request_failed(reason: impl Into<String>) -> Self

Create a network request failed error

Source

pub fn serialization_error(reason: impl Into<String>) -> Self

Create a serialization error

Source

pub fn home_directory_not_found() -> Self

Create a home directory not found error

Source

pub fn invalid_command( context: impl Into<String>, reason: impl Into<String>, ) -> Self

Create an invalid command error

Source

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

Source

pub fn jq_filter_error( filter: impl Into<String>, reason: impl Into<String>, ) -> Self

Create a JQ filter error

Source

pub fn transient_network_error( reason: impl Into<String>, retryable: bool, ) -> Self

Create a transient network error

Source

pub fn retry_limit_exceeded( max_attempts: u32, last_error: impl Into<String>, ) -> Self

Create a retry limit exceeded error

Source

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

Source

pub fn request_timeout(timeout_seconds: u64) -> Self

Create a request timeout error

Source

pub fn missing_path_parameter(name: impl Into<String>) -> Self

Create a missing path parameter error

Source

pub fn io_error(message: impl Into<String>) -> Self

Create a general I/O error

Source

pub const fn invalid_idempotency_key() -> Self

Create an invalid idempotency key error

Source

pub const fn editor_not_set() -> Self

Create an editor not set error

Source

pub fn editor_failed(name: impl Into<String>) -> Self

Create an editor failed error

Source

pub fn unknown_setting_key(key: impl Into<String>) -> Self

Create an unknown setting key error

Source

pub fn invalid_setting_value(key: SettingKey, value: impl Into<String>) -> Self

Create an invalid setting value error

Source

pub fn setting_value_out_of_range( key: SettingKey, value: impl Into<String>, reason: &str, ) -> Self

Create a setting value out of range error

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,