Skip to main content

DefaultError

Struct DefaultError 

Source
pub struct DefaultError { /* private fields */ }
Expand description

Default web error domain.

DefaultError is a marker type used as State::Error. It selects the built-in renderers for ntex errors: request data errors are rendered as 4xx responses and server-side failures as 5xx responses, with the error’s Display text as a plain-text body. The marker itself is never constructed.

Trait Implementations§

Source§

impl Debug for DefaultError

Source§

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

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

impl Display for DefaultError

Source§

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

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

impl Error for DefaultError

1.30.0 · 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<St> WebResponseError<St, DefaultError> for DefaultError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Error

InternalServerError for JsonError.

Serialization errors are server-side failures, such as a Json<T> or Form<T> responder failing to encode its value.

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Error

InternalServerError for FormError.

Serialization errors are server-side failures, such as a Json<T> or Form<T> responder failing to encode its value.

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Error

Available on crate feature openssl only.

BadRequest for openssl::ssl::Error

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St, T: Debug + 'static> WebResponseError<St, DefaultError> for HandshakeError<T>

Available on crate feature openssl only.

InternalServerError for openssl::ssl::HandshakeError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Error

Return BAD_REQUEST for de::value::Error

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Canceled

InternalServerError for Canceled

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St, E: Error + 'static> WebResponseError<St, DefaultError> for BlockingError<E>

InternalServerError for BlockingError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Utf8Error

Return BAD_REQUEST for Utf8Error

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for HttpError

Return InternalServerError for HttpError, Response generation can return HttpError, so it is internal error

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for Error

Return InternalServerError for io::Error

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for UrlGenerationError

InternalServerError for UrlGenerationError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for UrlencodedError

Response renderer for UrlencodedError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for JsonPayloadError

Response renderer for JsonPayloadError

Returns PayloadTooLarge for Overflow and BadRequest otherwise.

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for PathError

Error renderer for PathError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for QueryPayloadError

Error renderer QueryPayloadError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for PayloadError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for PayloadError

PayloadError returns two possible results:

  • Overflow returns PayloadTooLarge
  • Other errors returns BadRequest
Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for ParseError

Available on crate feature cookie only.

Return BadRequest for cookie::ParseError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for ContentTypeError

Return BadRequest for ContentTypeError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for ClientError

Convert ClientError to a server Response

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for ClientPayloadError

Convert ClientPayloadError to a server Response

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St> WebResponseError<St, DefaultError> for HandshakeError

Available on crate feature ws only.

Error renderer for ws::HandshakeError

Source§

fn error_response(&self, _: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more
Source§

impl<St, E> WebResponseError<St, DefaultError> for TimeoutError<E>
where E: Display + Debug + WebResponseError<St, DefaultError> + 'static,

Return GATEWAY_TIMEOUT for TimeoutError

Source§

fn error_response(&self, st: &St) -> HttpResponse

Generate response for error Read more
Source§

fn into(self) -> Box<dyn WebResponseError<St, Err>>
where Self: Sized,

Convert the error into a boxed trait object. Read more

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