Introducing Throw Statements in Deluge

Introducing Throw Statements in Deluge

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:
  1. throw raises the exception with the details you define.
  2. 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:
Quote
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:

Quote
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:
  1. The API response, for API-related failures
  2. The record ID and current field values, for validation errors
  3. The user input that triggered the issue, for form-level checks
  4. 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:

Quote
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

For detailed information, refer to the throw statement help page.

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 Creator Team
    • Sticky Posts

    • Zoho Creator + LLMs using Zoho MCP: Bring contextual AI into your apps

      Hello everyone, We're excited to share that Zoho Creator can now be integrated with leading AI models(like Claude) using Zoho MCP. As you know, Zoho Creator has been a pioneering low-code platform with a razor-sharp focus on making it easy to build business
    • Introducing Zoho Creator's 2025 Release Projection 2

      Hello Creators! I'm Prakash, from the Creator product management team, and today I'm delighted to unveil our next set of features as part of Release Projection 2 for 2025. With thoughtful analysis and planning, we've curated powerful new capabilities
    • Zoho Creator - 2023 Release Projection 1

      Hello everyone! A very Happy New Year to you and your family. Hope you're all good and having a great time using Zoho Creator to make your lives easier and your businesses prosper. 2022 was an action-packed year for us at Creator, and we hope to continue
    • Zoho Creator User Group meetups in a city near you! - Oct - Nov, 2023

      Greetings from the Zoho Creator team! We're hosting a series of Zoho Creator meetups in various cities across the globe, and we'd love to meet you there! Our meetups are a great opportunity to network with industry peers, exchange ideas and best practices,
    • Zoho Creator - 2023 Release Projection 2

      Hello everyone! Time truly flies when you're having an incredible journey, and today we mark the completion of an eventful and action-packed six months. It feels like just yesterday when we embarked on this adventure together with the launch of our new
    • Recent Topics

    • Set same ticket Threshold for Agent-Level Thresholds

      I am creating Agent-Level Thresholds for agents to auto-assign tickets in a Load-based Round Robin rule. I am unable to set the same number of Open tickets for agents when setting their Thresholds. For exampel: Agent 1 = 10 Agent 2 = 25 Agent 3 = SHOULD
    • Zoho Mail MCP connector

      Issue: Zoho Mail MCP connector (https://mail-organization-930963415.zohomcp.com/mcp/.../message) — OAuth authorization completes successfully in-browser ("Authentication successful"), but the issued token is rejected when the MCP client reconnects to
    • 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
    • Multiple criteria in searchRecords

      Hi, is it possible to search with multiple criteria in zoho.crm.searchRecords? I have tried several variations of the following without much success. CustomerRecord = zoho.crm.searchRecords("Contacts", "(First Name|=| lee)" && "(Last Name|=| spencer)"); Thanks. Chris
    • Plans to make "Generate Presentation with Zia AI" available as API endpoint?

      This 'Generate Presentation with Zia' feature has great potential, and we would like to be able to trigger it automatically from a workflow. https://show.zoho.com/home/ziaai/generate Is there already a way to trigger this via API? If not, is there any
    • How to setup noreply@ example.com

      How do I setup noreply@example.com so the mail never gets delivered. I currently have a catchall setup aswell.
    • Pleas unblock E-Mail-Adress service@montana-energie.de / kontakt@montana-energie.de

      Dear Zoho Support, Could you please unblock service@montana-energie.de / kontakt@montana-energie.de which belongs to a regular customer with whom we are having frequent business-related conversations. Thank you very much in advance, Erdem Kar homewise
    • Unable to change alias in the from field on the ZOHO mac app

      I have 1 main mail address, and 3 alias's. on the web mailbox when I create a new email, I can select the alias's from the dropdown in the from field. On the app no dropdown is available.
    • Zmail mobile application

      ho do i remove people from this app
    • My allies email (info@xxxx.com) was been deleted by system, and I can not build the same info allies email now

      Dear Zoho Mail Support Team, I am the super administrator of the Zoho organization 【Organization Name, as shown in Admin Console】. I am writing to report an urgent issue with two of our custom-domain email addresses and to request your help restoring
    • Cannot create mail account

      Hi, i have a problem, i can't create a mail account every time i try the error massage like this Oops! Something went wrong during mailbox creation. Please try again please help
    • Amazon.it always ends up in spam

      Emails from amazon.it always end up in the spam folder, even though I have added the domain and the various individual Amazon addresses for shipping, payments, and other matters to the trusted lists at the user administrator level. What should I che
    • Your Authenticate email domain (SPF, DKIM, DMARC) is bad to say the least

      How about actual instructions rather than vague generalities? There is no way to complete this with what is provided. Please provide specific verifiable steps.
    • Generate a Zoho Sign link

      From time to time I get a response "I never received your you e-document for electronic signature" is there a way to generate a Zoho Sign link to share.
    • ChatGPT Plugin / MCP Server auth error

      Hi all I'm trying to connect the ChatGPT plugin for Zoho CRM but after username stage of the auth process, I get this error from the URL https://mcp.zoho.eu/mcp-client/ {"error_description":"Invalid request url, Request is not as per defined in oauth
    • Zeptomail in the blacklists

      Hello, I noticed some hard bounces while sending emails, and upon checking the details, I see that we have been added to the blacklists of certain spam lists: Bounce category: Policy failure Reason: ip-issues Message: 5.7.1 Service unavailable; client
    • Zoho Desk training for administrators in EU and US region

      Hello Everyone, Get ready for the certified Virtual Classroom training for our Zoho Desk users in Europe and the US. Our in-house Zoho Desk expert, @Dheeraj | Zoho Desk, will conduct the virtual classroom training. This training focuses on simplifying
    • Possible to reorder Pipelines position?

      I have multiple Pipelines and want to reorder their positions, so that in the Deals module record for the Pipeline field, I have them ordered in a certain way. Is there a way to reorder the position of the Pipelines without deleting existing Pipelines
    • Categorize Items with Item Headers

      Hello customers, Did you ever want to classify items based on specific categories to help your customers understand your invoice better? With the new Item Header feature, you can easily categorize items in your invoices and estimates and give them a common title.  Item Headers are available in the Invoices, the Recurring Invoices and the Estimates module. It can be carried forward from estimates to invoices at the time of converting the estimates.  To add an item header: Go to the Estimates, Invoices
    • Gettting "You are Offline" Messages all the time

      Al of a sudden, a few days ago, I suddenly began getting a message on the bottom left side of the Mail App saying "You are Offline". Why? Does it mean I'm not getting incoming mails now? why is has started?
    • Zoho CRM Quotes – Subform and PDF/Writer Limitations

      Hello, I am encountering the following limitations in Zoho CRM Quotes: Custom product images cannot be uploaded in the subform – the image upload field cannot be added; only the file upload field is available. File upload placeholders cannot be used in
    • Invoice Only Shipped Items

      Dear Zoho, We are a company that deals with sales orders with 600-1000 lines We need to be able to do partial invoicing based on shipped items Right now when we click convert to invoice we can not only select items that have een shipped It takes hours
    • Alias Email Id already exists

      Hi, I just verified my domain sesque (dot) com and now I am trying to create the admin account using admin (at) sesque (dot) com, but I am getting an error saying "Alias Email Id already exists". I used to have another Zoho account with this email address,
    • Allow widgets to be placed between native sections in the Ticket Properties panel

      One of our biggest frustrations with the Tickets module is how rigid the Ticket Properties panel is. Every section there is built only from native Zoho Desk fields. We can add sections, rearrange fields, and pick layouts, but we can’t put anything custom
    • Show backordered items on packing slip

      We send out a lot of large orders, and often there are one or two things backordered. How can I fix the packing slips to show quantity ordered  & quantity packed There should also be the ability to "ship" 0 of an item so the receiver knows that things
    • Deleted Module

      I accidentally deleted a module and its fields. Im trying to get it back. Thanks to Youtubers flooding the internet with out of date videos I can't find how to get deleted modules back. The Recycle Bin doesn't have modules. Anyone know how to do thi
    • Set department automatically for incoming calls

      Is it possible, when receiving an incoming call through Zoho Desk (using Twilio integration), for the department to be auto-selected based on the phone line being called? Currently, we have to manually select the department from the dropdown menu when
    • Make better hiring decisions with Compare Applications and Zia Insights (Beta)

      When multiple candidates apply for different job openings, evaluating each application against the right job requirements can take time. Reviewing resumes, candidate details, and interview feedback separately can make it harder to assess role fit and
    • Support Plan: Recuring Issue

      Hi Zoho Team, Could you please look into this recurring alert and provide clarification on why this restriction is still in place? This issue has become a bottleneck in our workflow, significantly limiting our automation capabilities. We are unable to
    • mail sent to gmail goes directly to spam

      Hi TKIM and SPF are configured and verified. E-mails coming from zoho to my personal gmail account are going directly to the spam folder. How can I solve this? I can send you guys the headers privately if you need to.
    • Creating packages according to actual shipping processes

      Hi community. I would like to ask a question to see if there's a better method or workflow for the creation of packages in Zoho Inventory. There is a little confusion in some of Zoho's language relating to the use of term Packing Slip when connected to
    • mail

      We want our tracked links in campaign and journey emails to use our own domain instead of the shared maillist-manage.net domain. We have already created the CNAME links.rexven.com → customer-campaign.zoho.com (DNS only). Does our plan support a custom
    • Zoho Webinar - Sharing System Audio (NOT AVAILABLE)

      Hi, We are having a serious problem with Zoho Webinar. In the webinars we run, we very often share the audio from a video we are streaming directly from YouTube or other applications. Until recently we were using Zoom, but as we use other Zoho applications
    • Ad-hoc approvals are now available in CRM approval processes

      Released for all DCs. Hello everyone, We've introduced ad-hoc approvals in CRM approval processes. This enhancement lets approvers add additional approvers when needed, without changing the configured approval workflow. How the approval process works
    • Introducing PRM: Build, manage, and scale your partner ecosystem

      Growing a partner ecosystem is a good problem to have. What starts as a handful of partners can quickly turn into a maze of spreadsheets, emails, and disconnected processes. More partners mean more opportunities, greater reach, and new ways to grow
    • Data Subject Requests in Zoho Mail: Retrieve and export email data for legal and compliance needs

      Organizations are often required to retrieve specific email communication data in response to legal investigations or compliance audits. The Data Subject Requests (DSR) feature in the Zoho Mail Admin Console allows administrators to search for all email
    • Introducing live chat for Zoho CommunitySpaces

      Hello everyone, We’re happy to announce that your community members now have a direct line to you. Zoho CommunitySpaces now has a live chat widget, powered by Zoho SalesIQ, so a member can open a chat from your community and get a quick one-to-one answer
    • Moving software

      I need someone to customize zoho for my moving business I need to do the following . 1. Quote comes in from ezemove website or we enter customer details into the system 2. Email quote to customer based on hourly rate 3. Customer accepts quote deposit is taken 4. We convert the quote into a confirmation email and add job to the diary and assign resources to the job 5. Job gets completed and we enter invoice amount into the system and email the invoice Budget : neg | Duration : 1 month To leave a private
    • How To Create a Report with Subforms from Two Modules

      I want to create a report based on data in subforms over 2 separate modules. Can this be done? I tried to do it in Analytics, but one is a date field that needs to be grouped by month, and it doesn't look like Analytics can do this.
    • Introducing Zoho Commerce 2.0 — It's more than just selling!

      Hello! We are proud to launch Zoho Commerce 2.0, a reimagination of how online businesses look, feel, and function. This launch is both timely and symbolic, as we reaffirm our commitment to empowering small and medium enterprises with powerful, yet simple-to-use
    • Next Page