Enum highnoon::Error[][src]

pub enum Error {
    Http(Response),
    Internal(Error),
}

Error type expected to be returned by endpoints.

It can represent an HTTP level error which is useful for helper functions that wish to cause an early return from a handler (using the question mark operator). It can also represent any other kind of error (using the anyhow::Error type). These errors are logged (if you enable the logging filter) and converted to a 500 Internal Server Error with no other details.

HTTP level error should be created with the http methods (which accepts a Responder rather tnan just Response) and Internal errors should be created with the From/Into implementation.

Variants

Http(Response)

An error that should get returned to the client

Internal(Error)

Internal errors, reported as 500 Internal Server Error and logged locally

Implementations

impl Error[src]

pub fn http(resp: impl Responder) -> Self[src]

Create an Error from a Responder - the Responder will be converted to a response and returned to the HTTP Client exactly the same way as an Result::Ok would be. This is useful in conjunction with the ? operator for early returns.

Trait Implementations

impl Debug for Error[src]

impl Display for Error[src]

impl<E> From<E> for Error where
    E: Into<Error>, 
[src]

impl Responder for Error[src]

Auto Trait Implementations

impl !RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl !UnwindSafe for Error

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<!> for T[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> Same<T> for T

type Output = T

Should always be Self

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