Skip to content

Commit

Permalink
More discriptive exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicz committed Feb 24, 2018
1 parent 27d5b46 commit def76f3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arca/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ def __init__(self, *args, extra_info=None, **kwargs):
super().__init__(*args, **kwargs)
self.extra_info = extra_info

def __str__(self):
return "{}\n\n{}".format(
super().__str__(),
self.extra_info
)


class PushToRegistryError(ArcaException):

def __init__(self, *args, full_output=None, **kwargs):
super().__init__(*args, **kwargs)
self.full_output = full_output

def __str__(self):
return "{}\n\n{}".format(
super().__str__(),
self.full_output
)


class FileOutOfRangeError(ValueError, ArcaException):
pass
Expand All @@ -39,3 +51,9 @@ class RequirementsMismatch(ValueError, ArcaException):
def __init__(self, *args, diff=None, **kwargs):
super().__init__(*args, **kwargs)
self.diff = diff

def __str__(self):
return "{}\nDiff:\n{}".format(
super().__str__(),
self.diff
)

0 comments on commit def76f3

Please sign in to comment.