Hello everyone,
We're introducing a powerful addition to Deluge that gives you more precise control over error handling in your scripts.
Whether you're calling an external API, validating user input, or enforcing a business rule, there are moments when a script needs to stop and flag that something went wrong. Take API calls as an example: a script using invokeUrl gets marked as successful the moment the call is made, not when it actually succeeds. That means an API returning a 400, a rejected payload, or a silently failed transaction can all leave the script looking green while the business process behind it breaks.
Handling this today involves a lot of workarounds. It works, but it's tedious. That's why we're introducing the throw statement in Deluge.
What throw does
throw lets you explicitly raise a custom exception the moment something goes wrong, whether it's an API returning an error, a business rule being violated, or a validation check failing. The script stops right there and passes control to the nearest matching catch block.
throw and catch, working together
throw is designed to work hand-in-hand with catch. Think of it as a two-part flow:
- throw raises the exception with the details you define.
- catch picks up the exception and decides what to do with it, whether retrying, notifying someone, or handling it gracefully.
If no catch block is available to handle a thrown exception, the script terminates with the exception details, so a failure never gets silently swallowed.
A quick example
Here's a simple use of throw. If the order quantity is zero or negative, the script raises an exception and the catch block handles it:

try
{
if(orderQuantity <= 0)
{
throw "Invalid order quantity";
}
info "Order accepted.";
}
catch(e)
{
info "Order failed: " + e;
info "Line number: " + e.lineNo;
}
Now, let's consider a business scenario. Say you have a Deluge function that pushes a new invoice to an external accounting service:

invoicePayload = Map();
invoicePayload.put("invoice_id", "INV-1042");
invoicePayload.put("amount", 2500);
invoicePayload.put("currency", "USD");
try
{
response = invokeUrl
[
url : "https://api.example.com/invoices"
type : POST
parameters : invoicePayload
];
if(response.get("status") != "success")
{
throw {
"message" : "Invoice sync failed",
"data" : response
};
}
info "Invoice synced successfully.";
}
catch(e)
{
info "Sync failed: " + e.message;
info "API response: " + e.data;
info "Line number: " + e.lineNo;
}
Here, we've explicitly told throw to attach the API response as part of the exception. When the accounting service rejects the invoice, the script stops, and the calling catch block receives the full response for inspection (exactly the context needed to log, retry, or alert).
What else throw unlocks
A few things worth knowing once you start using throw:
Rich exception details
Along with a message, you can attach data of any Deluge type. This is what makes exceptions useful downstream. Some examples of what to pass:
- The API response, for API-related failures
- The record ID and current field values, for validation errors
- The user input that triggered the issue, for form-level checks
- Any custom object that helps the catch block understand what went wrong
Re-throwing exceptions
Sometimes one catch block isn't enough. Re-throwing lets you handle an exception at more than one level. You can nest try-catch blocks inside each other. An inner catch can do its own work with the exception, then pass the same exception up to an outer catch by throwing it again.
Sample code:

try
{
try
{
// sync logic here
}
catch(e)
{
info "Sync failed: " + e.message; // local logging
throw e; // re-throw to outer catch
}
}
catch(e)
{
// outer handler: notify the user, roll back, alert admin, etc.
}
The inner catch records the failure, and the outer catch handles the response like notifying or rolling back, without either duplicating the other's logic.
Exception propagation
If a function raises an exception without handling it, Deluge moves the exception up to the script that called the function, giving that script the chance to catch it. This is what makes reusable validation functions possible: you can write validation logic once, throw inside it freely, and let the calling script decide how to respond.
Documentation
We believe the throw statement will be a great value addition to your Deluge scripts. Give it a try and let us know what you think.
If you have any questions or need assistance, feel free to reach out; we're always happy to help.
Regards,
The Zoho Deluge Team
Recent Topics
How to Convert Emails to PDF Format in Batch
It is helpful to convert emails into PDF format when you want to save important messages, when you need to share business correspondence, or when you wish to keep email records for future reference. PDF files can be readily opened, printed, and shared
Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this?
Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this? I run a small retail business using WooCommerce and Zoho One. For months, I have been trying to resolve recurring synchronisation failures
Function #24: Automatically display deal name from Zoho CRM on quotes in Zoho Books
Deals allow businesses to organize and visualize their sales pipeline. This provides a clear overview of all potential opportunities and helps in making informed decisions. Zoho CRM empowers you to create deals or potentials for your clients and monitor
Lookups and Custom Modules
I created a Custom Module that I'm calling "Item Purchasing Group". This module will store information for groups of Items that must be purchased together (including minimum overall quantities and/or values, etc.). This will have a one-to-many relationship
Changing an existing item to different accounts & inventory-tracked
Hi everyone, I have an item in Zoho Books that was originally set up as a non-inventory item. Over time, I associated it with different sales and purchase accounts, and I now have many invoices, bills, and reports that use this item. My business process
Address limits per customer by edition
I’m on the Standard edition and have reached a limit of 30 addresses under a single customer. Before I move to an annual Professional subscription, I need to confirm the following: What is the maximum number of addresses allowed under one contact, and
Zoho Books | Product updates | October 2026
Hello users, October brings a range of new features and enhancements to Zoho Books, designed to simplify compliance, streamline accounting workflows, and improve inventory management. From the launch of the Nigeria Edition and France’s e-invoicing capabilities
Create custom rollup summary fields in Zoho CRM
Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
Button or Links order
Is there a way to re-order the buttons or links that are created? Moderation Update: With our recent enhancement to custom button creation from the layout editor, administrators can now reorder custom buttons directly from the layout editor, and this
Zoho Books | Product updates | August 2026
Hello users, July has been an exciting month for Zoho Books! This month, we're excited to introduce HTML PDF Templates, Placeholders as Pills, expanded approval workflows for Sales Returns and Journals, and significant compliance updates across the India,
Bulk updating tags
My organisation handles a number of restricted funds. We previously did this by having a chart of accounts where each restricted fund has its own income and expense accounts. However, our accountant changed this, moving all transactions into accounts
Download or Backup Bulk Emails from IMAP Server
Taking email messages from an IMAP server and saving them is a wise method for ensuring that important emails are kept safe and easy to access. No matter whether you have a business email address or a personal mailbox, keeping a local copy of your emails
Zoho Writer Label Template Merge/Print Via API/Webhook/Flow
Short version of goal: To be able to kick off a Zoho Writer Label Template Document via API or Webhook or even using Zoho Flow. As of right now I have been unable to figure out a way to do that. Long version of goal: We would like to press a button (run
Kaizen #263: Using Zoho CRM Skill to Build Widgets
Hello everyone! Welcome back to another exciting Kaizen post. In the previous Kaizen posts, we introduced the zoho-crm skill.md and explored how it can help with Zoho CRM APIs, Client Scripts, complex COQL queries, and Skill to build Queries. In this
Zoho notebook No login
Hello Team, I recently downloaded and installed the latest version of zoho notebook for windows. But I am not able to login without providing any sso or email address. Did you removed the no login feature for this app? This is just a windows app. can
Search is completely broken for PC
I go to note, try to search for "mtga" and it shows 702 results (it's a big note), highlights all letters "m" and I can't find anything. Same for "gathering" - it thinkgs I think only for "g". Looking for "zoho" shows as if I searched only for "z". Using
Losing description after merging tickets
Hello, We merge tickets when they are about the same topic from the same client. It happens sometimes. We recently noticed that after the merger only the description from the master ticket is left in a thread. And the slave-ticket description is erased.
Behind a great customer experience is a team
Hi everyone, October is here, and the first week marks the Customer service week. Each year, we thank our customer service professionals. Service professionals are all around us, even in our own workplaces: They handle essential administrative work like
What's New - August and September 2026 | Zoho Backstage
Hello everyone, August and September bring a fresh wave of intelligence to Zoho Backstage. AI takes the spotlight with tools that help you create content, support attendees, and manage how AI fits into your events. Alongside AI, we’ve refined email communication,
Images Not Displaying Properly in Zoho Desk
Hi, We are experiencing an issue with image rendering in Zoho Desk, affecting both incoming and outgoing emails. Images embedded in email conversations are not displaying properly. Instead, we see broken image icons or empty placeholders where the images
Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!
We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
Widget Height were destroyed
All widget heights in the Details Canvas view are broken. Moderation Update: This is a known issue with widget heights in Client Script popups and flyouts. A fix is in progress, and this post will be updated once it's released.
Zoho Projects - Has something changed regarding to linking Projects and Deals via the API?
I am trying to link Zoho Projects to Deals in CRM using the API, but each time, the Deal Contact is added as a Client user and receives an email invite asking them to join the organisation. These are internal projects and the customer should not have
How long does it take to review campaigns?
Hello Zoho, i scheduled my campaigns yesterday afternoon and it has been under review for over how many hours and those campaigns were supposed to be out yesterday so new ones can go out today. Is there something i'm doing wrong?
Convert MSG to PDF in Bulk with Attachment Free
Microsoft Outlook saves each email as an MSG file, keeping with it key information like the sender, the recipient, the subject, the date, the body of the message, and any attachments. It can, however, be quite difficult to access a large number of MSG
Using Mail Merge Template to Print Documents with One Subform Record's Fields per Document
Hello, We have a Mail Merge template created in Zoho Writer which is not able to perform the functionality which is currently required to automate the documentation task portion of our process. The CRM module we are primarily using is based on a "Loans"
Convert MBOX to PST File Using Free Methods
MBOX is a mailbox format that is used by various email clients and services, such as Thunderbird, Apple Mail, Eudora, and Google Takeout. Yet, in order to be able to open your MBOX emails in Microsoft Outlook, you have to convert them from MBOX to PST
Zoho Community Digest - September 2026 | Part 4
Hi everyone, and welcome back! The final week of September brought a revamped Books integration in Zoho CRM and Zoho Key Service for LLM access without API keys, Zoho Creator's audit trail becoming a full enterprise-grade auditing system, and Zoho One
Automate weekly reports from Channels | Zoho Cliq AI use case #01
Scrolling endlessly through numerous threads in a Cliq channel and manually counting how many have been closed, how long people took to reply, and who actually participated can be tedious. After 20 minutes, you might have a number that no one can verify.
Apple Mail to Outlook Converter - Export Apple Mac Mail to PST File
Apple Mail is a well-known email application among people who use Macs, whereas Microsoft Outlook is widely employed for both personal and business use. Should you decide to move from Apple Mail to Outlook, you'll probably need to transfer your mailbox
Creator -Dynamic addition of Customer Portal User Licenses
Hi, We have a Creator App for B2C about to get released. We are experiencing the Portal User license challenge. Unable to predict the number of users who will download and Subscribe. When a User is about Subscribe and the portal licenses does not exists,
Zoho Tables is now part of Zoho One!
Hey everyone! We've got some exciting news to share. Zoho Tables is now included in your Zoho One subscription at no extra cost. If you're already on Zoho One, head to your app list, add Zoho Tables, and get started right away. You don't need a separate
How to import PST files in Office 365?
You can import PST files into Office 365 using native Outlook applications, the Microsoft Purview network upload method, or specialized third-party migration tools. Choosing the right method depends on whether you are migrating a single mailbox or executing
[Webinar] Zoho CommunitySpaces MCP
New to MCP, or just exploring what's possible? Join us for a webinar on Zoho MCP and your community. We'll show you how Zoho CommunitySpaces and Zoho MCP work together, what your AI co-host can do inside your community, and how to get started. Register
Solution to Import OST File into Office 365.
In today’s digital workplace, organizations are rapidly moving toward cloud-based email systems for better flexibility, security, and collaboration. Microsoft 365 has become one of the most widely used platforms for business communication. A common requirement
How can I show an uploaded image larger/full size in a Zoho Forms response PDF?
Hi, I noticed that in a response PDF for Forms, the uploaded image is shown in a tiny box as seen in my screenshot. Is there any way I can make that appear larger in the response PDF? thanks.
Live connection to DS files in Zoho Creator / ChatGPT
As an idea, we are using ChatGPT to build with Zoho Creator (outside of Zia), which is works brilliantly to assist write deluge, provide test suggesitons etc. Currently we are uploading the DS files which are very point in time, it would be great to have
Meet PageHealth by Zoho PageSense: a free way to find out what's holding your page back
We all know the feeling. You've spent days tweaking headlines, moving buttons, and rewriting copy, and you're still not sure why visitors aren't sticking around. Revamping your website is hard, and figuring out what's actually getting in the way is even
Export Exchange Online Archive Mailboxes to PST for Microsft 365 Users
With Microsoft 365 it is possible to archive older emails in Exchange Online in order to keep the main mailbox tidy. If however you need to export the archived emails to a PST file for the purposes of backup, migration, compliance or for use offline,
Task Module quick create settings
Hello, requesting the Task module receive a quick create customization settings. We have added custom fields and have to select "More fields" at the bottom of the pop-up to access the custom fields.
Next Page