Catch unhandled exceptions cleanly.

master
q3k 2013-08-21 19:32:18 +02:00
parent 8556ba8edf
commit 86cccb367f
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,10 @@ def _public_api_method(path):
content = e.message
code = e.code
status = "error"
except Exception as e:
content = "Internal server error."
code = 500
status = "error"
last_transfer = models.Transfer.query.order_by(models.Transfer.date.desc()).first()
modified = str(last_transfer.date)