From 8cfdb3406c78a96b40e30d907685d120ba932e4e Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Wed, 31 Mar 2021 22:30:29 +0530 Subject: [PATCH] fix: Throw validation error instead --- frappe/handler.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/frappe/handler.py b/frappe/handler.py index 35f13059b6..29d9456c46 100755 --- a/frappe/handler.py +++ b/frappe/handler.py @@ -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