Skip to content

Commit

Permalink
added missing auth failure exception handeling
Browse files Browse the repository at this point in the history
  • Loading branch information
F483 committed Sep 1, 2015
1 parent d219671 commit 36eac2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dataserv/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def ping(btc_addr):
except LookupError:
msg = "Farmer not found."
return make_response(error_msg.format(msg), 404)
except AuthError:
msg = "Invalid authentication headers."
return make_response(error_msg.format(msg), 401)


@app.route('/api/address', methods=["GET"])
Expand Down Expand Up @@ -155,6 +158,9 @@ def set_height(btc_addr, height):
except LookupError:
msg = "Farmer not found."
return make_response(msg, 404)
except AuthError:
msg = "Invalid authentication headers."
return make_response(error_msg.format(msg), 401)


if __name__ == '__main__': # pragma: no cover
Expand Down

0 comments on commit 36eac2e

Please sign in to comment.