Merge pull request #2150 from nabinhait/hotfix
Add error traceback in comment if no message_log
This commit is contained in:
commit
7b3bf9ffd7
1 changed files with 6 additions and 2 deletions
|
|
@ -999,8 +999,12 @@ def execute_action(doctype, name, action, **kwargs):
|
|||
getattr(doc, action)(**kwargs)
|
||||
except frappe.ValidationError:
|
||||
# add a comment (?)
|
||||
doc.add_comment('Comment',
|
||||
_('Action Failed') + '<br><br>' + json.loads(frappe.local.message_log[-1]).get('message'))
|
||||
if frappe.local.message_log:
|
||||
msg = json.loads(frappe.local.message_log[-1]).get('message')
|
||||
else:
|
||||
msg = '<pre><code>' + frappe.get_traceback() + '</pre></code>'
|
||||
|
||||
doc.add_comment('Comment', _('Action Failed') + '<br><br>' + msg)
|
||||
|
||||
doc.notify_update()
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue