Skip to content

Commit

Permalink
Mantain the status code for VersionLockedError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Aug 8, 2018
1 parent bed6f2e commit d6cc500
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion readthedocs/doc_builder/exceptions.py
Expand Up @@ -9,9 +9,10 @@
class BuildEnvironmentException(Exception):

message = None
status_code = None

def __init__(self, message=None, **kwargs):
self.status_code = kwargs.pop('status_code', 1)
self.status_code = kwargs.pop('status_code', None) or self.status_code or 1
message = message or self.get_default_message()
super(BuildEnvironmentException, self).__init__(message, **kwargs)

Expand All @@ -35,6 +36,7 @@ class BuildEnvironmentCreationFailed(BuildEnvironmentError):
class VersionLockedError(BuildEnvironmentError):

message = ugettext_noop('Version locked, retrying in 5 minutes.')
status_code = 423


class ProjectBuildsSkippedError(BuildEnvironmentError):
Expand Down

0 comments on commit d6cc500

Please sign in to comment.