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