fix: Throw validation error instead

This commit is contained in:
Suraj Shetty 2021-03-31 22:30:29 +05:30 committed by GitHub
parent f0075f5b1f
commit 8cfdb3406c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,12 +54,7 @@ def execute_cmd(cmd, from_async=False):
try:
method = get_attr(cmd)
except Exception as e:
if frappe.local.conf.developer_mode:
raise e
else:
frappe.respond_as_web_page(title=_('Invalid Method'), html=_('Method not found'),
indicator_color='red', http_status_code=500)
return
frappe.throw(_('Invalid Method'))
if from_async:
method = method.queue