bedrock.exceptions.conflicting_object_exception

 1from .bedrock_exception import BedrockException
 2
 3
 4class ConflictingObjectException(BedrockException):  # pragma: unit
 5    """
 6    Throw this exception when the client has sent a request that conflicts with an existing object.
 7
 8    Default HTTP code: 409.
 9    """
10    def __init__(self, cls, unique_identifiers):
11        unique_identifiers_string = ', '.join(unique_identifiers)
12        unique_identifiers_message = (f"{cls.__name__} requires each or a combination of {unique_identifiers_string}"
13                                      f" to be unique. ")
14        super().__init__(f"{cls.__name__} already exists. {unique_identifiers_message}", error_code=409)
class ConflictingObjectException(bedrock.exceptions.bedrock_exception.BedrockException):
 5class ConflictingObjectException(BedrockException):  # pragma: unit
 6    """
 7    Throw this exception when the client has sent a request that conflicts with an existing object.
 8
 9    Default HTTP code: 409.
10    """
11    def __init__(self, cls, unique_identifiers):
12        unique_identifiers_string = ', '.join(unique_identifiers)
13        unique_identifiers_message = (f"{cls.__name__} requires each or a combination of {unique_identifiers_string}"
14                                      f" to be unique. ")
15        super().__init__(f"{cls.__name__} already exists. {unique_identifiers_message}", error_code=409)

Throw this exception when the client has sent a request that conflicts with an existing object.

Default HTTP code: 409.

ConflictingObjectException(cls, unique_identifiers)
11    def __init__(self, cls, unique_identifiers):
12        unique_identifiers_string = ', '.join(unique_identifiers)
13        unique_identifiers_message = (f"{cls.__name__} requires each or a combination of {unique_identifiers_string}"
14                                      f" to be unique. ")
15        super().__init__(f"{cls.__name__} already exists. {unique_identifiers_message}", error_code=409)