[fix] catch error in data import

This commit is contained in:
Rushabh Mehta 2017-08-24 16:05:47 +05:30
parent 4e456b4e42
commit 16129ce785
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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"))