pub enum Error {
Show 13 variants
Config(String),
Session(String),
SessionNotFound {
path: String,
},
Provider {
provider: String,
message: String,
},
Auth(String),
Tool {
tool: String,
message: String,
},
Validation(String),
Extension(String),
Io(Box<Error>),
Json(Box<Error>),
Sqlite(Box<Error>),
Aborted,
Api(String),
}Expand description
Main error type for the Pi application.
Variants§
Config(String)
Configuration errors
Session(String)
Session errors
SessionNotFound
Session not found
Provider
Provider/API errors
Auth(String)
Authentication errors
Tool
Tool execution errors
Validation(String)
Validation errors
Extension(String)
Extension errors
Io(Box<Error>)
IO errors
Json(Box<Error>)
JSON errors
Sqlite(Box<Error>)
SQLite errors
Aborted
User aborted operation
Api(String)
API errors (generic)
Implementations§
Source§impl Error
impl Error
Sourcepub fn provider(provider: impl Into<String>, message: impl Into<String>) -> Self
pub fn provider(provider: impl Into<String>, message: impl Into<String>) -> Self
Create a provider error.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Create a validation error.
Sourcepub const fn hostcall_error_code(&self) -> &'static str
pub const fn hostcall_error_code(&self) -> &'static str
Map this error to a hostcall taxonomy code.
The hostcall ABI requires every error to be one of:
timeout, denied, io, invalid_request, or internal.
Sourcepub const fn category_code(&self) -> &'static str
pub const fn category_code(&self) -> &'static str
Stable machine-readable error category for automation and diagnostics.
Sourcepub fn auth_diagnostic(&self) -> Option<AuthDiagnostic>
pub fn auth_diagnostic(&self) -> Option<AuthDiagnostic>
Classify auth/config errors into stable machine-readable diagnostics.
Sourcepub fn hints(&self) -> ErrorHints
pub fn hints(&self) -> ErrorHints
Map internal errors to a stable, user-facing hint taxonomy.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more