pub struct SesError {
pub code: SesErrorCode,
pub message: String,
pub status_code: StatusCode,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
An SES error response.
Fields§
§code: SesErrorCodeThe error code.
message: StringA human-readable error message.
status_code: StatusCodeThe HTTP status code.
source: Option<Box<dyn Error + Send + Sync>>The underlying source error, if any.
Implementations§
Source§impl SesError
impl SesError
Sourcepub fn new(code: SesErrorCode) -> Self
pub fn new(code: SesErrorCode) -> Self
Create a new SesError from an error code.
Sourcepub fn with_message(code: SesErrorCode, message: impl Into<String>) -> Self
pub fn with_message(code: SesErrorCode, message: impl Into<String>) -> Self
Create a new SesError with a custom message.
Sourcepub fn error_type(&self) -> &'static str
pub fn error_type(&self) -> &'static str
Returns the __type string for the JSON error response.
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Internal error.
Sourcepub fn missing_action() -> Self
pub fn missing_action() -> Self
Missing action header.
Sourcepub fn not_implemented(operation: &str) -> Self
pub fn not_implemented(operation: &str) -> Self
Not implemented.
Sourcepub fn invalid_parameter_value(message: impl Into<String>) -> Self
pub fn invalid_parameter_value(message: impl Into<String>) -> Self
Invalid parameter value.
Sourcepub fn invalid_action(action: &str) -> Self
pub fn invalid_action(action: &str) -> Self
Unknown/invalid action.
Sourcepub fn message_rejected(message: impl Into<String>) -> Self
pub fn message_rejected(message: impl Into<String>) -> Self
Message rejected.
Sourcepub fn template_does_not_exist(name: &str) -> Self
pub fn template_does_not_exist(name: &str) -> Self
Template does not exist.
Trait Implementations§
Source§impl Error for SesError
impl Error for SesError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SesError
impl !RefUnwindSafe for SesError
impl Send for SesError
impl Sync for SesError
impl Unpin for SesError
impl UnsafeUnpin for SesError
impl !UnwindSafe for SesError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more