Skip to content

Commit

Permalink
Merge pull request #48 from uc-cdis/fix/error
Browse files Browse the repository at this point in the history
fix(error): inherit Exception
  • Loading branch information
philloooo authored Nov 29, 2018
2 parents 51b88d9 + df1da16 commit 1dda8d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cirrus/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CirrusError(BaseException):
class CirrusError(Exception):
def __init__(self, message="There was an error within the cirrus library.", *args):
super(CirrusError, self).__init__(message)

Expand Down
5 changes: 3 additions & 2 deletions test/test_google_cloud_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,9 @@ def test_handled_exception_no_retry(test_cloud_manager):
test_cloud_manager.add_member_to_group(
member_email="[email protected]", group_id="abc"
)
assert logger_warn.call_count <= BACKOFF_SETTINGS["max_tries"] - 1
assert logger_error.call_count <= 1
assert logger_warn.call_count == 0
# two google api calls: get_group_members and add_member_to_group
assert logger_error.call_count >= 1


def test_handled_exception_403_no_retry(test_cloud_manager):
Expand Down

0 comments on commit 1dda8d1

Please sign in to comment.