alertmanager-bark-hook/utils/error_handler.py

11 lines
229 B
Python
Raw Permalink Normal View History

2022-08-08 05:51:01 +00:00
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