pub struct FailOnStatus { /* private fields */ }client only.Expand description
Layer for throwing service error with the response’s error status code.
Users can use FailOnStatus::all, FailOnStatus::client_error or
FailOnStatus::server_error for creating the FailOnStatus layer that convert all (4XX and
5XX), client error (4XX) or server error (5XX) to a error of service.
Implementations§
Source§impl FailOnStatus
impl FailOnStatus
Sourcepub fn all() -> Self
pub fn all() -> Self
Create a FailOnStatus layer that return error StatusCodeError for all error status
codes (4XX and 5XX).
Sourcepub fn client_error() -> Self
pub fn client_error() -> Self
Create a FailOnStatus layer that return error StatusCodeError for client error
status codes (4XX).
Sourcepub fn server_error() -> Self
pub fn server_error() -> Self
Create a FailOnStatus layer that return error StatusCodeError for server error
status codes (5XX).
Sourcepub fn detailed(self) -> Self
pub fn detailed(self) -> Self
Collect more details in StatusCodeError.
When error occurs, the request has been consumed and the original response will be dropped.
With this flag enabled, the layer will save more details in StatusCodeError.
Trait Implementations§
Source§impl Clone for FailOnStatus
impl Clone for FailOnStatus
Source§fn clone(&self) -> FailOnStatus
fn clone(&self) -> FailOnStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more