Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
bug: Return correct status code/errno for ADM auth failures
Browse files Browse the repository at this point in the history
Closes: #1345
  • Loading branch information
jrconlin committed Aug 13, 2019
1 parent e404674 commit e023ad6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions autopush/router/adm.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ def _route(self, notification, uaid_data):
self._base_tags,
reason="auth failure"
))
raise RouterException("Server error", status_code=500,
errno=902,
raise RouterException("Server error", status_code=502,
errno=901,
log_exception=False)
except Exception as e:
self.log.error("Unhandled exception in ADM Routing: %s" % e)
Expand Down
6 changes: 3 additions & 3 deletions autopush/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ def test_bad_token_refresh(self):
}),
body=data
)
assert response.code == 500
assert response.code == 502
self.flushLoggedErrors()

@inlineCallbacks
Expand Down Expand Up @@ -2192,9 +2192,9 @@ def test_bad_sends(self):
}),
body="BunchOfStuff"
)
assert response.code == 500
assert response.code == 502
rbody = json.loads(body)
assert rbody["errno"] == 902
assert rbody["errno"] == 901
self.flushLoggedErrors()

# fake a valid ADM key
Expand Down

0 comments on commit e023ad6

Please sign in to comment.