Struct preroll::JsonError[][src]

pub struct JsonError {
    pub status: u16,
    pub title: String,
    pub message: String,
    pub request_id: RequestId,
    pub correlation_id: Option<String>,
    pub honeycomb_trace_id: Option<String>,
}

The structure of an error as formatted by preroll's error handling middleware.

A service using preroll will always respond with a JSON body in this format if an internal or client error occurs.

An example of the structure as it would be in JSON:

{
  "status": 422,
  "title": "Unprocessable Entity",
  "message": "missing field \"address\"",
  "request_id": "00000000-0000-0000-0000-000000000000"
  "correlation_id": null,
}

Fields

status: u16

The http status code. Refer to httpstatuses.com for a nice reference.

title: String

The 'canonical reason' of the http status code as specified in rfc7231 section 6.1, implemented via http_types::StatusCode.

message: String

The origin error message for 4XX client errors.

In case of an 5XX internal server error, this field will be "Internal Server Error (correlation_id=00000000-0000-0000-0000-000000000000)".

If the original error context is missing, this field will be "(no additional context)".

request_id: RequestId

The UUID v4 assigned to the request, possibly from an incoming header.

correlation_id: Option<String>

The service-unique UUID v4 assigned to the error response for 5XX internal server errors.

honeycomb_trace_id: Option<String>
This is supported on crate feature honeycomb only.

If the honeycomb feature is enabled, this will be the honeycomb trace id associated with this request.

Trait Implementations

impl Debug for JsonError[src]

impl<'de> Deserialize<'de> for JsonError[src]

impl Serialize for JsonError[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> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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<D> OwoColorize for D

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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

impl<T> WithSubscriber for T[src]