sagemaker.core.exceptions#

Custom exception classes for Sagemaker SDK

Exceptions

AsyncInferenceError(**kwargs)

The base exception class for Async Inference exceptions.

AsyncInferenceModelError(message)

Raised when model returns errors for failed requests

AutoMLStepInvalidModeError(**kwargs)

Raised when the automl mode passed into AutoMLStep in invalid

CapacityError(message, allowed_statuses, ...)

Raised when resource status is not expected and fails with a reason of CapacityError

InternalStreamFailure([message])

Raised when invoke_endpoint_with_response_stream Response returns InternalStreamFailure

ModelStreamError([message, code])

Raised when invoke_endpoint_with_response_stream Response returns ModelStreamError

ObjectNotExistedError(message, output_path)

Raised when Amazon S3 object not exist in the given path

PollingTimeoutError(message, output_path, ...)

Raised when wait longer than expected and no result object in Amazon S3 bucket yet

UnexpectedClientError(message)

Raised when ClientError's error code is not expected

UnexpectedStatusException(message, ...)

Raised when resource status is not expected and thus not allowed for further execution

exception sagemaker.core.exceptions.AsyncInferenceError(**kwargs)[source]#

Bases: Exception

The base exception class for Async Inference exceptions.

fmt = 'An unspecified error occurred'#
exception sagemaker.core.exceptions.AsyncInferenceModelError(message)[source]#

Bases: AsyncInferenceError

Raised when model returns errors for failed requests

fmt = 'Model returned error: {message} '#
exception sagemaker.core.exceptions.AutoMLStepInvalidModeError(**kwargs)[source]#

Bases: Exception

Raised when the automl mode passed into AutoMLStep in invalid

fmt = 'Mode in AutoMLJobConfig must be defined for AutoMLStep. AutoMLStep currently only supports ENSEMBLING mode'#
exception sagemaker.core.exceptions.CapacityError(message, allowed_statuses, actual_status)[source]#

Bases: UnexpectedStatusException

Raised when resource status is not expected and fails with a reason of CapacityError

exception sagemaker.core.exceptions.InternalStreamFailure(message='An error occurred')[source]#

Bases: Exception

Raised when invoke_endpoint_with_response_stream Response returns InternalStreamFailure

exception sagemaker.core.exceptions.ModelStreamError(message='An error occurred', code=None)[source]#

Bases: Exception

Raised when invoke_endpoint_with_response_stream Response returns ModelStreamError

exception sagemaker.core.exceptions.ObjectNotExistedError(message, output_path)[source]#

Bases: AsyncInferenceError

Raised when Amazon S3 object not exist in the given path

fmt = 'Object not exist at {output_path}. {message}'#
exception sagemaker.core.exceptions.PollingTimeoutError(message, output_path, seconds)[source]#

Bases: AsyncInferenceError

Raised when wait longer than expected and no result object in Amazon S3 bucket yet

fmt = 'No result at {output_path} after polling for {seconds} seconds. {message}'#
exception sagemaker.core.exceptions.UnexpectedClientError(message)[source]#

Bases: AsyncInferenceError

Raised when ClientError’s error code is not expected

fmt = 'Encountered unexpected client error: {message}'#
exception sagemaker.core.exceptions.UnexpectedStatusException(message, allowed_statuses, actual_status)[source]#

Bases: ValueError

Raised when resource status is not expected and thus not allowed for further execution