Skip to content

Commit

Permalink
fix: Add error handler for status 429 (#6678)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rits1272 authored and iamareebjamal committed Jan 13, 2020
1 parent 3ea3814 commit 3fad651
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/instance.py
Expand Up @@ -261,5 +261,17 @@ def internal_server_error(error):
{'Content-Type': 'application/vnd.api+json'})


@app.errorhandler(429)
def ratelimit_handler(error):
return make_response(json.dumps({
'status': 429,
'title': 'Request Limit Exceeded'
}),
429,
{
'Content-Type': 'application/vnd.api+json'
})


if __name__ == '__main__':
current_app.run()

0 comments on commit 3fad651

Please sign in to comment.