seitime-frappe/frappe/www/error.py
Suraj Shetty 1431cb26d3 fix: Catch any expection and show proper error page
- Also, show title & message if it is defined in the exception class
2022-06-01 08:08:52 +05:30

16 lines
468 B
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe import _
no_cache = 1
def get_context(context):
if frappe.flags.in_migrate:
return
context.error_title = context.error_title or _("Uncaught Server Exception")
context.error_message = context.error_message or _("There was an error building this page")
return {"error": frappe.get_traceback().replace("<", "&lt;").replace(">", "&gt;")}