pub trait ServiceError: Error {
// Required methods
fn error_code(&self) -> &'static str;
fn http_status(&self) -> StatusCode;
}
Expand description
A trait for errors that can be converted to an HTTP response and a string error code.
Error codes typically are more descriptive than HTTP status reasons. The AWS Identity and Access Management
Common Errors reference has examples of
typical error codes, including IncompleteSignature
, InvalidAction
, InvalidClientTokenId
,
InvalidParameterCombination
, etc.
Required Methods§
Sourcefn error_code(&self) -> &'static str
fn error_code(&self) -> &'static str
The string status code for this error.
Sourcefn http_status(&self) -> StatusCode
fn http_status(&self) -> StatusCode
The HTTP status code for this error.