Skip to content

Commit

Permalink
fix: handle http status code 401 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
hfreire committed Jun 25, 2017
1 parent 5a12c7b commit f6ec831
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/happn-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const handleResponse = ({ statusCode, statusMessage, body }) => {
if (statusCode >= 300) {
switch (statusCode) {
case 401:
case 410:
throw new HappnNotAuthorizedError()
default:
throw new Error(`${statusCode} ${statusMessage}`)
Expand Down

0 comments on commit f6ec831

Please sign in to comment.