pub struct EventsError {
pub code: EventsErrorCode,
pub message: String,
pub status_code: StatusCode,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
An EventBridge error response.
Fields§
§code: EventsErrorCodeThe 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 EventsError
impl EventsError
Sourcepub fn new(code: EventsErrorCode) -> Self
pub fn new(code: EventsErrorCode) -> Self
Create a new EventsError from an error code.
Sourcepub fn with_message(code: EventsErrorCode, message: impl Into<String>) -> Self
pub fn with_message(code: EventsErrorCode, message: impl Into<String>) -> Self
Create a new EventsError 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 resource_not_found(message: impl Into<String>) -> Self
pub fn resource_not_found(message: impl Into<String>) -> Self
Resource not found.
Sourcepub fn resource_already_exists(message: impl Into<String>) -> Self
pub fn resource_already_exists(message: impl Into<String>) -> Self
Resource already exists.
Sourcepub fn invalid_event_pattern(message: impl Into<String>) -> Self
pub fn invalid_event_pattern(message: impl Into<String>) -> Self
Invalid event pattern.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Validation error.
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 unknown_operation(target: &str) -> Self
pub fn unknown_operation(target: &str) -> Self
Unknown operation.
Sourcepub fn not_implemented(operation: &str) -> Self
pub fn not_implemented(operation: &str) -> Self
Not implemented.
Sourcepub fn limit_exceeded(message: impl Into<String>) -> Self
pub fn limit_exceeded(message: impl Into<String>) -> Self
Limit exceeded.
Trait Implementations§
Source§impl Debug for EventsError
impl Debug for EventsError
Source§impl Display for EventsError
impl Display for EventsError
Source§impl Error for EventsError
impl Error for EventsError
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 EventsError
impl !RefUnwindSafe for EventsError
impl Send for EventsError
impl Sync for EventsError
impl Unpin for EventsError
impl UnsafeUnpin for EventsError
impl !UnwindSafe for EventsError
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