Zoho Deluge: Throw Statements for Custom Exception Handling
Click here for the full article.
Deluge now supports the throw statement, allowing developers to explicitly raise custom exceptions when scripts encounter errors or failed business rules.
throw works with try-catch blocks, immediately stopping execution and passing the exception to the nearest matching catch block.
Exceptions can include a custom message and additional data, such as API responses, record details, field values, or user input.
Developers can re-throw exceptions so errors can be handled at multiple levels, such as logging locally before triggering notifications or rollback logic.
Exceptions can also propagate between functions, allowing reusable validation or integration functions to pass failures back to the calling script.
The update is particularly useful for API integrations, where developers can now explicitly flag unsuccessful responses instead of allowing failed transactions to appear successful.