Error Handling | Online Help | Qntrl | Circuit

Error Handling

In Qntrl Circuit, you can configure error handling while building a Circuit. In most cases, state definition errors are detected even before saving the Circuit, i.e. when you save the Circuit, it runs a compilation check and lists out errors related to its state configurations, logic flow, and design. This will help you to verify and fix errors in your Circuit design and configuration even before execution.

 

Only Functional states, such as Function, Webhook, and Circuit, are bound to have runtime errors, so the error handling feature is only supported for Functional states. When you add a Functional state (Function, Webhook, or Circuit), the Error Handling option appears under Configuration on the right panel.

Runtime errors are classified into the following four scenarios:
  1. On Timeout
  2. On Authorization Failure
  3. On Execution Failure
  4. Custom Error

On Timeout

When a Functional state runs longer than the expected time, a timeout error occurs. This option is available for Function and Webhook. 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. This option is available only for the Webhook state. In Code View, the name value "errorType": "Error.AuthorizationFailure" is added.

On Execution Failure

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

 

When you select any of the above error handling options, a pop-up appears with Retry and Fallback fields. These two fields are common for all the error-handling options. 


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 in 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.

For example, suppose the Delay is set to 5 seconds, Attempt is set to 3, and Step Delay is set to 2 seconds for a retry.                         

New Delay Time = Delay * Step Delay ^ (attempt - 1)

  1st attempt       -->       5s * (2 ^ 0) = 5s  

             2nd attempt      -->       5s * (2 ^ 1) = 10s

             3rd attempt       -->       5s * (2 ^ 2) = 20s

The first retry attempt takes place after 5 seconds, the second attempt takes 10 seconds, and the third attempt takes 20 seconds to get executed.


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. NextSet the state name to which the inputs of the failed state and error output have to be passed.
  2. Result: Set the field name from which the error details can be retrieved.
  3. Error Path: Maps error responses in case of failure, specifying the input for the next state.
  4. Error Selector: Configures error responses which can be merged with the previous state input and transitioned to the Fallback state.
      Refer to the Input and Output Processing section to know in detail about Error Path and Error Selector.


Custom Error 

You can also have custom error handling for your Circuit. You can handle the exceptions in your function through an Error Code or an Error Message besides Retry and Fallback options. 
  1. Click the +Add Custom Error option under Error Handling. A pop-up appears.
  2. Under Exception, select Error Code/Error Message from the dropdown using which the error handling must take place.
  3. In the next field, enter the path/value where the error code or error message will be received in the state output.


  • By default, the Custom Error name is set to Error 1Error 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, the name value "errorType": "Error.Custom" is appended.


A sample state that handles an On Timeout and Custom Error in Code View is displayed below.

{ "Function for stock status": {       "type": "function",       "next": "End",       "start": true,       "function_id": "updatestockstatus_71",       "on_error": [       {           "error_type": "timeout_error",           "retry": {              "delay": 3,              "attempt": 3,              "step_delay": 1           },        "fallback": {                "next": "End",               "error_path": "$.error3"          }       },       {        "error_type": "custom_error",        "error_name": "Error 1",        "error_code": "101",        "retry": {             "delay": 3,             "attempt": 3,             "step_delay": 1        },        "fallback": {
            "next": "End",
            "error_path": "$.Error"        }       }      ] } }


    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








                                    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

                                                                                                      • Error selector and Error path

                                                                                                        Error Selector and Error Path are used to manage errors in a system. While Result Selector and Result Path control the output of a state upon successful execution, Error Selector and Error Path come into play when the are exceptional circumstances, ...
                                                                                                      • Task Engine

                                                                                                        Circuit's Task Engine state is used to connect with other applications and access APIs from a closed space. To retrieve data from a private network, the required API must be accessed from the local machine's network for the required conditions. ...
                                                                                                      • SSH Engine

                                                                                                        SSH Engine state is configured to connect to a client's machine or network and remotely execute commands or scripts on the client's Linux/UNIX operating system. Prerequisite Bridge must be installed and should be active. To learn how to install and ...
                                                                                                      • Circuit

                                                                                                        As you may know, Circuit enables you to create automated workflows for IT and business by organizing a sequence of tasks. In certain cases, a process might include complex sub-processes that can be constructed as separate standalone Circuits. These ...
                                                                                                      • Features of Circuit

                                                                                                        Configure with or without code Circuit provides a platform to build workflow orchestrations with or without code. You can either visually design the Circuit schematics by dragging and dropping its elements in Builder View, or build its JSON code in ...
                                                                                                        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