[Zoho crm. Custom function]

[Zoho crm. Custom function]

My custom function uses postUrl() function for integration with another service.
Whenever retrieved responseStatus of the call is 500 ( ( response.get("responseStatus") == 500 ) )
the custom function execution should be marked as failure - so later I can track 'failed' calls.

Is there any way to explicitly throw errors/exceptions in custom functions?
Or any other suggested solutions, please?

Thanks.
Anton