alertmanager-bark-hook/utils/error_handler.py
2022-08-08 05:51:01 +00:00

11 lines
229 B
Python

import traceback
from app import app
def error_handler(e):
app.logger.warning(e, traceback.format_exc())
return {
'success': False,
'message': 'Error: {0}'.format(str(e)),
'data': None
}, 500