ZoeyError

Enum ZoeyError 

Source
pub enum ZoeyError {
Show 26 variants DatabaseSqlx(Error), Database(String), Plugin(String), Runtime(String), Model(String), Memory(String), Serialization(Error), Io(Error), Config(String), Validation(String), Network(Error), Template(String), Service(String), Event(String), Action(String), Provider(String), Evaluator(String), NotFound(String), Auth(String), RateLimit(String), Timeout(String), Other(String), DatabaseConstraintViolation { table: String, constraint: String, value: String, suggestion: String, }, VectorSearch { message: String, dimension: usize, expected_dimension: usize, }, MissingField { field: String, context: String, suggestion: String, }, ResourceExhausted { resource: String, message: String, current: usize, limit: usize, },
}
Expand description

Main error type for ZoeyOS operations

Variants§

§

DatabaseSqlx(Error)

Database operation error (from sqlx)

§

Database(String)

Database operation error (custom message)

§

Plugin(String)

Plugin-related error

§

Runtime(String)

Runtime error

§

Model(String)

Model/LLM error

§

Memory(String)

Memory operation error

§

Serialization(Error)

Serialization/deserialization error

§

Io(Error)

IO error

§

Config(String)

Configuration error

§

Validation(String)

Validation error

§

Network(Error)

Network/HTTP error

§

Template(String)

Template rendering error

§

Service(String)

Service error

§

Event(String)

Event handling error

§

Action(String)

Action execution error

§

Provider(String)

Provider error

§

Evaluator(String)

Evaluator error

§

NotFound(String)

Not found error (generic)

§

Auth(String)

Authentication/authorization error

§

RateLimit(String)

Rate limit error

§

Timeout(String)

Timeout error

§

Other(String)

Generic error with context

§

DatabaseConstraintViolation

Database constraint violation with details

Fields

§table: String

Database table name

§constraint: String

Constraint name

§value: String

Attempted value

§suggestion: String

Suggestion for fixing

§

VectorSearch

Vector search error

Fields

§message: String

Error message

§dimension: usize

Actual embedding dimension

§expected_dimension: usize

Expected embedding dimension

§

MissingField

Missing required field

Fields

§field: String

Field name

§context: String

Context where field is missing

§suggestion: String

Suggestion for fixing

§

ResourceExhausted

Resource exhausted

Fields

§resource: String

Resource name

§message: String

Error message

§current: usize

Current usage

§limit: usize

Maximum limit

Implementations§

Source§

impl ZoeyError

Source

pub fn database(msg: impl Into<String>) -> Self

Create a database error

Source

pub fn plugin(msg: impl Into<String>) -> Self

Create a plugin error

Source

pub fn runtime(msg: impl Into<String>) -> Self

Create a runtime error

Source

pub fn model(msg: impl Into<String>) -> Self

Create a model error

Source

pub fn memory(msg: impl Into<String>) -> Self

Create a memory error

Source

pub fn config(msg: impl Into<String>) -> Self

Create a config error

Source

pub fn validation(msg: impl Into<String>) -> Self

Create a validation error

Source

pub fn service(msg: impl Into<String>) -> Self

Create a service error

Source

pub fn event(msg: impl Into<String>) -> Self

Create an event error

Source

pub fn action(msg: impl Into<String>) -> Self

Create an action error

Source

pub fn provider(msg: impl Into<String>) -> Self

Create a provider error

Source

pub fn evaluator(msg: impl Into<String>) -> Self

Create an evaluator error

Source

pub fn not_found(msg: impl Into<String>) -> Self

Create a not found error

Source

pub fn auth(msg: impl Into<String>) -> Self

Create an auth error

Source

pub fn rate_limit(msg: impl Into<String>) -> Self

Create a rate limit error

Source

pub fn timeout(msg: impl Into<String>) -> Self

Create a timeout error

Source

pub fn other(msg: impl Into<String>) -> Self

Create a generic error

Source

pub fn template(msg: impl Into<String>) -> Self

Create a template error

Source

pub fn constraint_violation( table: impl Into<String>, constraint: impl Into<String>, value: impl Into<String>, suggestion: impl Into<String>, ) -> Self

Create a constraint violation error

Create a vector search error

Source

pub fn missing_field( field: impl Into<String>, context: impl Into<String>, suggestion: impl Into<String>, ) -> Self

Create a missing field error

Source

pub fn resource_exhausted( resource: impl Into<String>, message: impl Into<String>, current: usize, limit: usize, ) -> Self

Create a resource exhausted error

Trait Implementations§

Source§

impl Debug for ZoeyError

Source§

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

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

impl Display for ZoeyError

Source§

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

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

impl Error for ZoeyError

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 ZoeyError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ZoeyError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ZoeyError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ZoeyError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ZoeyError> for ApiError

Source§

fn from(err: ZoeyError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
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