I have an API method which takes a parameter. It looks like:
http://<ip>/api/method/some_func?some_arg=<>
In case the end user doesn’t provide the some_arg
URL parameter. I want to handle it better without her seeing the full traceback.
What I’ve done is:
def some_func(some_arg):
if not some_arg:
return frappe.respond_as_web_page("Server Error",
"Invalid Arg.",
success=False,
http_status_code=417)
But it looks like the function doesn’t even enter and frappe throws an ugly full trace-back to the end user. Is there a cleaner approach to handle in production?
Thanks