diff --git a/frappe/handler.py b/frappe/handler.py index 4845b4d725..84002c4e88 100755 --- a/frappe/handler.py +++ b/frappe/handler.py @@ -117,6 +117,7 @@ def uploadfile(): ret = method() except Exception: frappe.errprint(frappe.utils.get_traceback()) + frappe.response['http_status_code'] = 500 ret = None return ret diff --git a/frappe/public/js/frappe/request.js b/frappe/public/js/frappe/request.js index 128ac996da..19b622e8ee 100644 --- a/frappe/public/js/frappe/request.js +++ b/frappe/public/js/frappe/request.js @@ -137,8 +137,11 @@ frappe.request.call = function(opts) { 500: function(xhr) { frappe.utils.play_sound("error"); frappe.msgprint({message:__("Server Error: Please check your server logs or contact tech support."), title:__('Something went wrong'), indicator: 'red'}); - opts.error_callback && opts.error_callback(); - frappe.request.report_error(xhr, opts); + try { + opts.error_callback && opts.error_callback(); + } catch (e) { + frappe.request.report_error(xhr, opts); + } }, 504: function(xhr) { frappe.msgprint(__("Request Timed Out"))