Source code for dynamodb_encryption_sdk.exceptions

# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
"""Exception classed for use in the DynamoDB Encryption Client."""


[docs]class DynamodbEncryptionSdkError(Exception): """Base class for all custom exceptions."""
[docs]class InvalidArgumentError(DynamodbEncryptionSdkError): """Raised when a general invalid argument is provided."""
[docs]class SerializationError(DynamodbEncryptionSdkError): """Otherwise undifferentiated errors encountered while serializing data."""
[docs]class DeserializationError(DynamodbEncryptionSdkError): """Otherwise undifferentiated errors encountered while deserializing data."""
[docs]class InvalidMaterialDescriptionError(DeserializationError): """Raised when errors are encountered processing a material description."""
[docs]class InvalidMaterialDescriptionVersionError(DeserializationError): """Raised when a material description is encountered with an invalid version."""
[docs]class InvalidAlgorithmError(InvalidArgumentError): """Raised when an invalid algorithm identifier is encountered."""
[docs]class JceTransformationError(DynamodbEncryptionSdkError): """Otherwise undifferentiated errors encountered when attempting to read a JCE transformation."""
[docs]class DelegatedKeyError(DynamodbEncryptionSdkError): """Otherwise undifferentiated errors encountered by a DelegatedKey."""
[docs]class DelegatedKeyEncryptionError(DelegatedKeyError): """Raised when a DelegatedKey encounters an error during encryption."""
[docs]class DelegatedKeyDecryptionError(DelegatedKeyError): """Raised when a DelegatedKey encounters an error during decryption."""
[docs]class AwsKmsMaterialsProviderError(DynamodbEncryptionSdkError): """Otherwise undifferentiated errors encountered by the AwsKmsCryptographicMaterialsProvider."""
[docs]class UnknownRegionError(AwsKmsMaterialsProviderError): """Raised when the AwsKmsCryptographicMaterialsProvider is asked for an unknown region."""
[docs]class DecryptionError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while decrypting data."""
[docs]class UnwrappingError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while unwrapping a key."""
[docs]class EncryptionError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while encrypting data."""
[docs]class WrappingError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while wrapping a key."""
[docs]class SigningError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while signing data."""
[docs]class SignatureVerificationError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered while verifying a signature."""
[docs]class ProviderStoreError(DynamodbEncryptionSdkError): """Otherwise undifferentiated error encountered by a provider store."""
[docs]class NoKnownVersionError(ProviderStoreError): """Raised if a provider store cannot locate any version of the requested material."""
[docs]class InvalidVersionError(ProviderStoreError): """Raised if an invalid version of a material is requested."""
[docs]class VersionAlreadyExistsError(ProviderStoreError): """Raised if a version that is being added to a provider store already exists."""