Break out MissingKey as separate exception. Closes #571.
This commit is contained in:
parent
03903800ff
commit
b932343fec
3 changed files with 21 additions and 7 deletions
|
|
@ -6,6 +6,10 @@ ERROR_WITH_BUCKET_NAME = """{% extends 'error' %}
|
|||
{% block extra %}<BucketName>{{ bucket }}</BucketName>{% endblock %}
|
||||
"""
|
||||
|
||||
ERROR_WITH_KEY_NAME = """{% extends 'error' %}
|
||||
{% block extra %}<KeyName>{{ key_name }}</KeyName>{% endblock %}
|
||||
"""
|
||||
|
||||
|
||||
class S3ClientError(RESTError):
|
||||
pass
|
||||
|
|
@ -40,6 +44,17 @@ class MissingBucket(BucketError):
|
|||
*args, **kwargs)
|
||||
|
||||
|
||||
class MissingKey(S3ClientError):
|
||||
code = 404
|
||||
|
||||
def __init__(self, key_name):
|
||||
super(MissingKey, self).__init__(
|
||||
"NoSuchKey",
|
||||
"The specified key does not exist.",
|
||||
Key=key_name,
|
||||
)
|
||||
|
||||
|
||||
class InvalidPartOrder(S3ClientError):
|
||||
code = 400
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue