#[non_exhaustive]pub enum InvokeEndpointError {
InternalDependencyException(InternalDependencyException),
ModelNotReadyException(ModelNotReadyException),
InternalFailure(InternalFailure),
ValidationError(ValidationError),
ModelError(ModelError),
ServiceUnavailable(ServiceUnavailable),
Unhandled(Unhandled),
}
Expand description
Error type for the InvokeEndpointError
operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InternalDependencyException(InternalDependencyException)
Your request caused an exception with an internal dependency. Contact customer support.
ModelNotReadyException(ModelNotReadyException)
Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.
InternalFailure(InternalFailure)
An internal failure occurred.
ValidationError(ValidationError)
Inspect your request and try again.
ModelError(ModelError)
Model (owned by the customer in the container) returned 4xx or 5xx error code.
The service is unavailable. Try your call again.
Unhandled(Unhandled)
Unhandled
directly is not forwards compatible. Instead, match using a variable wildcard pattern and check .code()
:
err if err.code() == Some("SpecificExceptionCode") => { /* handle the error */ }
See ProvideErrorMetadata
for what information is available for the error.An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
Implementations§
source§impl InvokeEndpointError
impl InvokeEndpointError
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the InvokeEndpointError::Unhandled
variant from any error type.
sourcepub fn generic(err: ErrorMetadata) -> Self
pub fn generic(err: ErrorMetadata) -> Self
Creates the InvokeEndpointError::Unhandled
variant from an ErrorMetadata
.
sourcepub fn meta(&self) -> &ErrorMetadata
pub fn meta(&self) -> &ErrorMetadata
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn is_internal_dependency_exception(&self) -> bool
pub fn is_internal_dependency_exception(&self) -> bool
Returns true
if the error kind is InvokeEndpointError::InternalDependencyException
.
sourcepub fn is_model_not_ready_exception(&self) -> bool
pub fn is_model_not_ready_exception(&self) -> bool
Returns true
if the error kind is InvokeEndpointError::ModelNotReadyException
.
sourcepub fn is_internal_failure(&self) -> bool
pub fn is_internal_failure(&self) -> bool
Returns true
if the error kind is InvokeEndpointError::InternalFailure
.
sourcepub fn is_validation_error(&self) -> bool
pub fn is_validation_error(&self) -> bool
Returns true
if the error kind is InvokeEndpointError::ValidationError
.
sourcepub fn is_model_error(&self) -> bool
pub fn is_model_error(&self) -> bool
Returns true
if the error kind is InvokeEndpointError::ModelError
.
Returns true
if the error kind is InvokeEndpointError::ServiceUnavailable
.
Trait Implementations§
source§impl CreateUnhandledError for InvokeEndpointError
impl CreateUnhandledError for InvokeEndpointError
source§fn create_unhandled_error(
source: Box<dyn Error + Send + Sync + 'static>,
meta: Option<ErrorMetadata>
) -> Self
fn create_unhandled_error( source: Box<dyn Error + Send + Sync + 'static>, meta: Option<ErrorMetadata> ) -> Self
source
and error metadata.source§impl Debug for InvokeEndpointError
impl Debug for InvokeEndpointError
source§impl Display for InvokeEndpointError
impl Display for InvokeEndpointError
source§impl Error for InvokeEndpointError
impl Error for InvokeEndpointError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<InvokeEndpointError> for Error
impl From<InvokeEndpointError> for Error
source§fn from(err: InvokeEndpointError) -> Self
fn from(err: InvokeEndpointError) -> Self
source§impl ProvideErrorMetadata for InvokeEndpointError
impl ProvideErrorMetadata for InvokeEndpointError
source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
source§impl RequestId for InvokeEndpointError
impl RequestId for InvokeEndpointError
source§fn request_id(&self) -> Option<&str>
fn request_id(&self) -> Option<&str>
None
if the service could not be reached.