How to: Configure Integration Error Handling

Prev Next

This how-to guide introduces an effective way to reference the integratorErrors object, develop custom error messages, and learn new ways to display them.

To review the basics of error handling, view our Introduction to Error Handling article.

Using a Data Workflow to Reference integratorErrors

Use a Data Workflow component to incorporate integrateErrors in the following ways:

  • When data manipulation or modification is required.

  • When dealing with objects and arrays.

Configuration

For this example, you’ll configure a Plug-In component that includes error handling. The Plug-In component is triggered by a Button component, and an error trigger is initiated in your Data Workflow if the Plug-In component fails to complete its designated task. Subsequently, the integratorErrors object references the error that occurred, and a specific error message is displayed in a modal. For this example, the appearance of the error message indicates success.

These instructions assume you have a new module open, saved, and with a title.

Select the tab that corresponds to your Unqork Designer experience:

Configure the Button Component

Begin by adding a Button component to trigger your Plug-In component.

  1. In the Module Builder, drag and drop a Button component onto your canvas.

  2. In the Property ID field, enter btnFireError.

  3. In the Label Text field, enter Submit Error.

  4. From the Action Type drop-down, select Event.

  5. From the On Click drop-down, select pluginCallError.

    A static image displaying the Button configuration showing action type and triggers for error submission.

  6. Click Save Component.

Configure the Plug-In Component

Next, configure a Plug-In component to execute a broken API call. Any remote execution that ensures a broken API call is beneficial, as it helps to examine different error codes and messages that might arise. So, you’ll use the Combine PDFs internal API call. You’ll retain the Data Source URL as the default for this configuration, which guarantees that the API call lacks sufficient information to operate effectively. Subsequently, the Plug-In component will send its Error Trigger to initiate the Data Workflow.

  1. Drag and drop a Plug-In component onto your canvas, placing it below the Submit Error Button component.

  2. In the Property ID and Canvas Label Text fields, enter pluginCallError.

  3. In the Error Trigger field, enter dwfErrorHandling.

  4. From the Internal Services drop-down, select Combine PDFs. The Data Source URL automatically populates with /fbu/uapi/pdfbar/combine.

    The Plug-In component does not fire correctly if you do not change the autopopulated Data Source URL.

    A static image displaying the Plugin component settings for Unqork plugin with error handling and PDF combining options.

  5. Click Save Component.

Configure the Hidden Components

Next, configure two Hidden components to store the error response codes and error messages for the respective error codes.

  1. Drag and drop two Hidden components onto your canvas, placing them below the pluginCallError Plug-In component.

  2. In the Property ID and Label Text fields, enter the following:

    #

    Property ID

    Canvas Label Text

    1

    errorCode

    errorCode

    2

    errorMessage

    errorMessage

  3. Click Save Component after adding each component.

Configure the Decisions Component

Now, configure the Decisions component to display the error messages based on the error response code. The error codes and messages are customized to ensure you consider every potential error.

  1. Drag and drop a Decisions component onto your canvas, placing it below your Hidden components.

  2. In the Property ID and Canvas Label Text fields, enter ruleErrorPopMessage.

  3. In the Inputs table, enter the following:

    #

    Source

    Type

    Required

    1

    errorCode

    exact

    (checked)

  4. In the Outputs table, enter the following:

    #

    Source

    Type

    1

    errorMessage

    popError

  5. In the Conditionals table, enter the following:

    #

    errorCode

    errorMessage_popError

    1

    400

    400 Bad Request: Invalid request and/or request is not formed properly. Reformulate the request.

    2

    401

    401 Not Authorized: Invalid credentials, or authentication credentials must be provided.

    3

    404

    404 Not Found: Invalid URL request, or the resource in question doesn't exist.

    4

    500

    500 Internal Server Error: Error encountered by the Internal server. A notification is sent, and the error is investigated.

    5

    502

    502 Bad Gateway: Internal systems error or upgrade in progress. Or, the internal system is overloaded, and the issue will resolve soon.

    6

    503

    503 Service Unavailable: The request cannot be processed as a result of the suspension of this service.

    A static image displaying the Decision rules for error codes and corresponding messages in a software interface.

  6. Click Save Component.

Configure the Data Workflow Component

Now, configure the Data Workflow. The unsuccessful Plug-In component triggers the error code and runs the Data Workflow. The Data Workflow outputs the response code and message for that specific error.

  1. Drag and drop a Data Workflow component onto your canvas, placing it between your pluginCallError Plug-In and Hidden components.

  2. In the Property ID and Canvas Label Text fields, enter dwfErrorHandling.

Configure the Input Operator

Begin by adding an Input operator to reference the input integratorErrors. However, note that integratorErrors is located outside of the data object, so it cannot be selected from the operator's Component drop-down menu. You must manually input the integratorErrors because it’s not included in your configuration.

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    Required

    Yes

    Source

    Default

  3. In the Component field of the operator’s Info window, double-click and enter integratorErrors.

  4. Press Enter (Return) on your keyboard.

Configure the code Get Operator

Next, configure a Get operator to retrieve the response code of your error.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Label

    code

    Path

    pluginCallError.code

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the code Get operator.

Configure the errorCode Output Operator

Now, configure an Output operator to output the response code of the error to your errorCode Hidden component.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    errorCode

    Action

    value

  3. Connect the output port (right) of the code Get operator to the input port (left) of the errorCode Output operator.

Configure the message Get Operator

Next, configure another Get operator to retrieve the custom message for the error.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Label

    message

    Path

    pluginCallError.message

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the message Get operator.

Configure the errorMessage Output Operator

Next, configure another Output operator to output the error message to your errorMessage Hidden component.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    errorMessage

    Action

    value

  3. Connect the output port (right) of the message Get operator to the input port (left) of the errorMessage Output operator.

Configure the ruleErrorPopMessage Output Operator

Configure another Output operator that triggers your Decisions component and displays the error message.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    ruleErrorPopMessage

    Action

    trigger

  3. Connect the output port (right) of the message Get operator to the input port (left) of the ruleErrorPopMessage Output operator.

Configure the Console Operator

Lastly, configure a Console operator and connect it to your integratorErrors Input operator. The integratorErrors object for your error displays, emphasizing the importance of your custom error messages.

  1. Drag and drop a Console operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Console

    Label

    integratorErrors

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the integratorErrors Console operator.

    A static image displaying the Data workflow diagram showing error handling with inputs and outputs for messages and codes.

  4. Click Save Component.

  5. Save your module.

Here’s how your completed module looks in the Module Builder:

A static image displaying the Error submission interface displaying error code and message fields for troubleshooting.

Preview your module in Express View and open the DevTools Console. Click the Submit Error button, and you’ll notice that a 400 response code displays. If you expand the integratorErrors Console and the pluginCallError data, the following message displays: "/pdfbar/combine expects an array \"pdfUrls\" to combine". Some of these default messages lack information, but the custom message in your modal provides more details about the issue. This error alerts you to the incorrectly formatted API request in your Plug-in component.

Configure the Button Component

Begin by adding a Button component to trigger your Plug-In component.

  1. In the Module Builder, drag and drop a Button component onto your canvas.

  2. In the Property ID field, enter btnFireError.

  3. In the Label Text field, enter Submit Error.

  4. Set the Action Type as Event.

  5. From the On Click drop-down, select pluginCallError.

    A static image displaying the Button configuration settings for triggering an event on click with user feedback options.

  6. Click Save & Close.

Configure the Plug-In Component

Next, configure a Plug-In component to execute a broken API call. Any remote execution that ensures a broken API call is beneficial, as it helps to examine different error codes and messages that might arise. So, you’ll use the Combine PDFs internal API call. You’ll retain the Data Source URL as the default for this configuration, which guarantees that the API call lacks sufficient information to operate effectively. Subsequently, the Plug-In component will send its Error Trigger to initiate the Data Workflow.

  1. Drag and drop a Plug-In component onto your canvas, placing it below the Submit Error Button component.

  2. In the Property ID and Canvas Label Text fields, enter pluginCallError.

  3. In the Error Trigger field, enter dwfErrorHandling.

  4. From the Internal Services drop-down, select Combine PDFs. The Data Source URL automatically populates with /fbu/uapi/pdfbar/combine. Don’t make any changes to the URL.

    The Plug-In component does not fire correctly if you do not change the autopopulated Data Source URL.

    A static image displaying the Plugin component settings for combining PDFs and error handling.

  5. Click Save.

Configure the Hidden Components

Next, configure two Hidden components to store the error response codes and error messages for the respective error codes.

  1. Drag and drop two Hidden components onto your canvas, placing them below the pluginCallError Plug-In component.

  2. In the Property ID and Canvas Label Text fields, enter as follows:

    Property ID

    Canvas Label Text

    errorCode

    errorCode

    errorMessage

    errorMessage

  3. Save each component.

Configure the Decisions Component

Now, configure the Decisions component to display the error messages based on the error response code. The error codes and messages are customized to ensure you consider every potential error.

  1. Drag and drop a Decisions component onto your canvas, placing it below your Hidden components.

  2. In the Property ID and Canvas Label Text fields, enter ruleErrorPopMessage.

  3. In the Inputs table, enter the following:

    Property ID

    Type

    Required

    errorCode

    exact

    (checked)

  4. In the Outputs table, enter the following:

    Property ID

    Type

    errorMessage

    popError

  5. In the Micro Decisions table, enter the following:

    Input Values

    Output Values

    errorCode

    errorMessage_popError

    400

    400 Bad Request: Invalid request and/or request is not formed properly. Reformulate the request.

    401

    401 Not Authorized: Invalid credentials, or authentication credentials must be provided.

    404

    404 Not Found: Invalid URL request, or the resource in question doesn't exist.

    500

    500 Internal Server Error: Error encountered by the Internal server. A notification is sent, and the error is investigated.

    502

    502 Bad Gateway: Internal systems error or upgrade in progress. Or, the internal system is overloaded, and the issue will resolve soon.

    503

    503 Service Unavailable: The request cannot be processed as a result of the suspension of this service.

    A static image displaying the Decisions component settings interface displaying error codes and messages for decision-making processes.

  6. Click Save.

Configure the Data Workflow Component

Now, configure the Data Workflow. The unsuccessful Plug-In component triggers the error code and runs the Data Workflow. The Data Workflow outputs the response code and message for that specific error.

  1. Drag and drop a Data Workflow component onto your canvas, placing it between your pluginCallError Plug-In and Hidden components.

  2. In the Canvas Label Text and Property Name fields, enter dwfErrorHandling.

Configure the Input Operator

Start by adding an Input operator. The Input operator references the input integratorErrors. However, note that integratorErrors is located outside of the data object, so it cannot be selected from the operator's Component drop-down menu. You need to manually input the integratorErrors since it is not included in your configuration.

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    Required

    Yes

    Source

    Default

  3. In the Component field of the operator’s Info window, double-click and enter integratorErrors.

  4. Press Enter (Return) on your keyboard.

Configure the code Get Operator

Next, configure a Get operator to retrieve the custom message for the error.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Label

    code

    Path

    pluginCallError.code

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the message Get operator.

Configure the errorCode Output Operator

Now, configure an Output operator to output the response code of the error to your errorCode Hidden component.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    errorCode

    Action

    value

  3. Connect the output port (right) of the code Get operator to the input port (left) of the errorCode Output operator.

Configure the message Get Operator

Next, configure a Get operator to retrieve the custom message for the error.

  1. Drag and drop a Get operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Label

    message

    Path

    pluginCallError.message

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the message Get operator.

Configure the errorMessage Output Operator

Next, configure another Output operator to output the error message to your errorMessage Hidden component.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    errorMessage

    Action

    value

  3. Connect the output port (right) of the message Get operator to the input port (left) of the errorMessage Output operator.

Configure the ruleErrorPopMessage Output Operator

Configure another Output operator that triggers your Decisions component and displays the error message.

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    ruleErrorPopMessage

    Action

    trigger

  3. Connect the output port (right) of the message Get operator to the input port (left) of the ruleErrorPopMessage Output operator.

Configure the Console Operator

Lastly, configure a Console operator and connect it to your integratorErrors Input operator. The integratorErrors object for your error displays, emphasizing the importance of your custom error messages.

  1. Drag and drop a Console operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Console

    Label

    integratorErrors

  3. Connect the output port (right) of the integratorErrors Input operator to the input port (left) of the integratorErrors Console operator.

    A static image displaying the Data workflow diagram illustrating error handling with input and output processes.

  4. Click Save.

  5. Save your module.

Here’s how your completed module looks in the Module Builder:

A static image displaying the Error handling interface displaying plugin call error and related messages.

Preview your module in Express View and open the DevTools Console. Click the Submit Error button, and you’ll notice that a 400 response code displays. If you expand the integratorErrors Console and the pluginCallError data, the following message displays: "/pdfbar/combine expects an array \"pdfUrls\" to combine". Some of these default messages lack information, but the custom message in your modal provides more details about the issue. This error alerts you to the incorrectly formatted API request in your Plug-in component.