Enum aragog::error::ServiceError[][src]

pub enum ServiceError {
    InternalError {
        message: Option<String>,
    },
    ValidationError(String),
    NotFound {
        item: String,
        id: String,
        source: Option<DatabaseError>,
    },
    UnprocessableEntity {
        source: Box<dyn Error>,
    },
    ArangoError(DatabaseError),
    InitError {
        item: String,
        message: String,
    },
    Unauthorized,
    Forbidden,
}

Error enum used for the Arango ORM mapped as potential Http errors

Features

If the cargo feature actix is enabled, ServiceError will implement the actix-web error system. Allowing ServiceError to be used in actix-web http endpoints.

Variants

InternalError

Unhandled error. Can be interpreted as a HTTP code 500 internal error.

Fields of InternalError

message: Option<String>

Optional message (will not be displayed)

ValidationError(String)

Validations failed (see model validation as implemented in Validate. Can be interpreted as a HTTP code 400 bad request.

NotFound

An Item (document or collection) could not be found. Can be interpreted as a HTTP code 404 not found.

Fields of NotFound

item: String

The missing item

id: String

The missing item identifier

source: Option<DatabaseError>

Optional database source error

UnprocessableEntity

An operation failed due to format or data issue.

Can be interpreted as a HTTP code 422 Unprocessable Entity.

Fields of UnprocessableEntity

source: Box<dyn Error>

The source error

ArangoError(DatabaseError)

The ArangoDb Error as returned by the database host

Can be interpreted as a HTTP code 500 Internal Error.

InitError

Failed to load config or initialize the app.

Can be interpreted as a HTTP code 500 Internal Error.

Fields of InitError

item: String

Item that failed to init

message: String

Error message

Unauthorized

The operation is refused due to lack of authentication. Can be interpreted as a HTTP code 401 unauthorized.

Forbidden

The operation is refused and authentication cannot resolve it. Can be interpreted as a HTTP code 403 forbidden.

Implementations

impl ServiceError[src]

pub fn http_code(&self) -> &str[src]

get the matching http code

Trait Implementations

impl Debug for ServiceError[src]

impl Default for ServiceError[src]

impl Display for ServiceError[src]

impl Error for ServiceError[src]

impl From<ClientError> for ServiceError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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