Skip to main content

Error detection configuration

Connectors are used with Data Pages to read data — such as customer and insurance policy data — from an external system. When a connector is invoked by a Data Page, error detection identifies and addresses any integration errors. Each connector includes an error handling flow.

Data source errors

Data Pages are loaded on demand. Errors may occur when retrieving data from a data source.

Examples of errors include:

  • Time out: a source system or database is down
  • Invalid request: an invalid authentication or data request
  • System error: an error during loading or on the external system

The type of data source that is used to load the Data Page affects how errors are detected and handled. Data source errors must be handled as part of the Data Page load mechanism.

When Data Pages invoke a connector, best practices are to:

  • Add error detection to all Data Pages
  • Invoke a reusable error handling Data Transform to identify and address errors
Note: Pega Platform™ provides a template for a Data Transform called pxErrorHandlingTemplate, as a reusable error-handling Data Transform. The pxErrorHandlingTemplate Data Transform is in the base class.

Error handling logic

Design your error handling logic based on business needs and the types of errors that occur. Three situations to consider are: 

  • When an error is fixable by the user
  • When an error is not fixable by the user, but processing can continue (for example, if the data is not mandatory for the Process)
  • When an error is not fixable by the user, and Case processing must stop

Early error detection

To ensure the best user experience, identify errors as early as possible in the Process, with clear error messages explaining to the user what happened and what they should do next. Whenever possible, include an alternate Process flow when the Case cannot proceed, such as to open a chat for assistance, or send an email to confirm to the user that an error resolution Case has been created.

Response Data Transform

The Connector, Report definition, and Lookup data source options of a Data Page require a Response Data Transform. Apply the best practice of checking for errors directly in the Response Data Transform using a When Condition to check for any error messages on the Data Page. If errors exist, call a separate Error handling Data Transform.

Error messages

If there is an issue, an error message displays on the Clipboard. If the error is correctable by the user, display an error message to explain to the user how to correct it.

Response Data Transform Error Message

Error handling flow

The Error handling flow feature identifies errors that are not detected in a Data Page or in a Data Transform. Pega Platform automatically invokes the Error handler flow if the error is not addressed by another mechanism. This feature is always enabled and allows you to implement a Process for handling the error. It is typically used when the connector response is not required immediately — for example, when updating a legacy system.

Note: The error handler flow does not run if the error is detected in the response Data Transform. 

You can configure the Error handling flow on the Service tab for the connector. By default, connectors use the standard ConnectionProblem flow. The flow can be copied and customized. You may also choose to create an alternative error handler flow.


When an error occurs, the original flow execution is paused. Control is handed over to the Error handler flow. If the resource is not responding to a request, a transient error may be preventing processing. If there is a transient error, the connector is retried, and processing continues in a flow called FlowProblems.


The FlowProblems flow either routes the work item to a problem flow workbasket or notifies an operator about the issue.

The operator may:

  • Retry the connector
  • Resume the flow without retrying the connector
  • Restart the initial flow
  • Cancel the error handling flow
Note: As a best practice, notify the user about the error, and whenever possible, reroute to an alternate Process so that the user is not stuck on the screen waiting for something to happen. 

Error handling Data Transform

The template for the Error handling Data Transform includes examples of calls to standard utility Functions. You can configure the Data Transform to customize error handling behavior, such as providing more user-friendly error messages.

In the following image, click the + icons to learn more about Error handling data transform template:

Retry a connector invoked from a Data Page

If the returned error is temporary, give the user the option to retry the connector. To retry the connector, configure the Data Page refresh strategy:

  1. Create a When Condition that returns true when there are no error messages.
  2. Configure the Do not reload when setting so that the Data Page does not reload if there are no error messages. 
Note: When more than one system or step of persistency is required, plan your error handling carefully. The error handling in this situation must account for the possibility of an error with any of the individual transactions, the availability of compensating actions (such as rollback APIs) for any transactions that had already completed, and whether the Case can proceed and how.

Addressing responses from returned errors

If there is an immediate need for the response to be returned by the invoked service, in addition to providing an error message to the user, you should write the error to the log file. Writing a message to the log file helps you troubleshoot errors. For example, you analyze the log file to identify patterns related to a specific error. In the log message, include details about the connector request to help identify the cause of the error.

Tip: To learn more about the details provided in the error log, see Errors in data sources. In addition to writing the error to a log file, consider generating an email with details about the error to notify the system administrator or another interested party.

Check your knowledge with the following interaction:

This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice