Skip to content

Commit

Permalink
exception logging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
otter18 committed Mar 28, 2021
1 parent 19d08e5 commit f8cb0e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
gunicorn
Flask
werkzeug
sslcrypto
pyTelegramBotAPI
datetime
Expand Down
6 changes: 5 additions & 1 deletion webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytz
from flask import request
from werkzeug.exceptions import HTTPException

from setup import *

Expand All @@ -15,8 +16,11 @@
# -------------- Exception handler --------------
@app.errorhandler(Exception)
def handle_exception(e):
if isinstance(e, HTTPException):
return e

logger.error(traceback.format_exc())
# return "Oops", 500
return "Oops", 500


# -------------- status webpage --------------
Expand Down

0 comments on commit f8cb0e3

Please sign in to comment.