pub struct IamError {
pub code: IamErrorCode,
pub message: String,
pub status_code: StatusCode,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
An IAM error response.
Fields§
§code: IamErrorCodeThe 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 IamError
impl IamError
Sourcepub fn new(code: IamErrorCode) -> Self
pub fn new(code: IamErrorCode) -> Self
Create a new IamError from an error code.
Sourcepub fn with_message(code: IamErrorCode, message: impl Into<String>) -> Self
pub fn with_message(code: IamErrorCode, message: impl Into<String>) -> Self
Create a new IamError 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 parameter.
Sourcepub fn unknown_operation(action: &str) -> Self
pub fn unknown_operation(action: &str) -> Self
Unknown operation.
Sourcepub fn not_implemented(operation: &str) -> Self
pub fn not_implemented(operation: &str) -> Self
Not implemented.
Sourcepub fn no_such_entity(message: impl Into<String>) -> Self
pub fn no_such_entity(message: impl Into<String>) -> Self
Entity not found.
Sourcepub fn entity_already_exists(message: impl Into<String>) -> Self
pub fn entity_already_exists(message: impl Into<String>) -> Self
Entity already exists.
Sourcepub fn delete_conflict(message: impl Into<String>) -> Self
pub fn delete_conflict(message: impl Into<String>) -> Self
Delete conflict (entity has subordinate entities).
Sourcepub fn limit_exceeded(message: impl Into<String>) -> Self
pub fn limit_exceeded(message: impl Into<String>) -> Self
Limit exceeded.
Sourcepub fn malformed_policy_document(message: impl Into<String>) -> Self
pub fn malformed_policy_document(message: impl Into<String>) -> Self
Malformed policy document.
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
Invalid input.
Sourcepub fn invalid_security(message: impl Into<String>) -> Self
pub fn invalid_security(message: impl Into<String>) -> Self
Invalid security / auth error.
Trait Implementations§
Source§impl Error for IamError
impl Error for IamError
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 IamError
impl !RefUnwindSafe for IamError
impl Send for IamError
impl Sync for IamError
impl Unpin for IamError
impl UnsafeUnpin for IamError
impl !UnwindSafe for IamError
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