Error Handling

Error Handling


A state can run into errors for various reasons. In Zoho Circuit, most of the state definition errors are intimated before saving the circuit. Only functional states, such as function, webhook, and circuit, are bound to have runtime errors, the error handling feature is only supported for functional states. Runtime errors are classified into the following four scenarios:
  1. On Timeout
  2. On Authorization Failure
  3. On Execution Failure
  4. Custom Error
All four error handling options have two common fields, Retry and Fallback. You can define the error handling fields for a state under Configuration
 

On Timeout

When a functional state runs longer than the expected time, timeout errors occur. For handling timeout errors in code view, the field value "errorType": "Error.TimeOut"  will be added.

On Authorization Failure

If a state fails because of insufficient privileges to access the specified code, the error is handled as an authorization failure. In code view, name value "errorType": "Error.AuthorizationFailure" is added.

On Execution Failure

When a state's execution fails due to some exception which cannot be processed, it can be handled using execution failure. In code view, name value "errorType": "Error.ExecutionFailure" is appended.

Custom Error

You can customize your error handling using the error code or error message provided by the state output. For this, you need to configure Exception Type and Exception Value.
  1. Exception Type - Provide 'Error Code' or 'Error Message' from the drop down using which the error handling must take place.
  2. Exception Value - Enter the exact value of error code or error message that will be received in the state output.


By default, Custom Error name is set to Error 1, Error 2 or Error 3 based on the number of custom errors configured. To change the default name, click the 'edit' icon and specify a name.

 For custom errors in code view, name value "errorType": "Error.Custom" is appended.
 
All the above error handling options configures two fields: Retry and Fallback

Retry

You can retry the failed state for a specific number of attempts within predefined intervals using this option.
Retry consists of three fields:
  1. Delay - Set the time, number of seconds after which the state must be retried after failure.
  2. Attempt - Set the number of times the state has to be retried
  3. Step Delay - Increase the delay time for each attempt by multiplying the Delay time with the Step Delay number set.
                        New Delay Time = Delay * Step Delay
 For example, suppose the Delay is set to 5 seconds, Attempt is set to 3 and Step Delay is set to 2 for a 'Retry'. Then the first retry attempt takes place after 10 (5*2) seconds, the second attempt takes 20 (10*2) seconds and the third attempt takes 40 (20*2) seconds to get executed.
 
                        New Delay Time = Delay * Step Delay
      1st attempt        >            10s = 5s * 2
      2nd attempt      >           20s = 10s * 2
      3rd attempt       >           40s = 20s * 2


Fallback

In case of failure or error, the failed state can fall back to another state to continue the execution.
For setting up fallback, configure the following two fields:
  1. Next - Set the state name to which the inputs of the failed state and error output have to be passed'.
  2. Result - Set the field name in which the error received for the failed state has to be sent to the fallback state.

 
A sample state that handles an 'On Timeout' and 'Custom Error' in code view is displayed below.
  1. "SayHello": {
  2.       "type": "function",
  3.       "next": "branch",
  4.       "parameter": {
  5.             "name": "James"
  6.       },
  7.       "functionName": "HelloWorld_name",
  8.       "onError": [
  9.             {            
  10.                   "errorType": "Error.TimeOut",
  11.                   "retry": {
  12.                         "delay": 3,
  13.                         "attempt": 2,
  14.                         "stepDelay": 1
  15.                   },
  16.                   "fallback": {
  17.                         "result": "$.erroroutput",
  18.                         "next": "HelloWorld"
  19.                   }
  20.             },
  21.             {
  22.                   "errorType": "Error.Custom",
  23.                   "errorName": "Error 1",
  24.                   "errorCode": "101",
  25.                   "retry": {
  26.                   "delay": 3,
  27.                   "attempt": 3,
  28.                   "stepDelay": 1
  29.             },
  30.             "fallback": {
  31.                   "result": "$.error",
  32.                   "next": "Hello"
  33.             }
  34.       }
  35. ]

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION





                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          CRM Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal
                          Mobile App
                          Form Designer HR
                          Mobile Forms
                          Card Forms Food Offline Forms
                          Assign Forms Photography
                          Mobile Forms Features
                          Translate Forms Real Estate Kiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for Forms Alternatives Security & Compliance
                          Holiday Forms Google Forms alternative  GDPR
                          Form to PDF Jotform alternative HIPAA Forms
                          Email Forms
                          Encrypted Forms
                          Embeddable Forms
                          Secure Forms
                          Drag and Drop form builder
                          WCAG


                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Functions

                                                                                                                  Function is a program script that performs a set of operations whenever invoked within an application. Set up functions in Zoho Circuit to actualize your business routines. Circuit's functions are serverless, where the cloud provider dynamically ...
                                                                                                              • Webhook

                                                                                                                Webhook enables communication between third-party applications and Zoho Circuit. With webhooks, you can make API calls and notify the applications whenever an action takes place in Zoho Circuit.   Set up webhooks in the following three steps: Create ...
                                                                                                              • Circuits

                                                                                                                The main purpose of Zoho Circuit is to build efficient circuits in the form of workflows to coordinate multiple microservices. Circuits are state machines that can trigger and track each step automatically, and retry when there are errors.  Setting ...
                                                                                                              • States in Zoho Circuit

                                                                                                                In Zoho Circuit, states are building blocks of a circuit that can perform tasks, make decisions, or simply pass the output from one state to another. You can build circuits with states using the drag and drop functionality in Builder View, or with ...
                                                                                                              • Introduction to Zoho Circuit

                                                                                                                What is Zoho Circuit? Zoho circuit is a platform for integrating microservices to create automated workflows. With sophisticated flow controls, you can create custom applications or processes as workflows, without writing any code. Workflows created ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources