Exception handling in Pega Connect-REST

 Error handling when using Pega Connect-REST involves catching response codes from the server and taking the appropriate action in the application.

By default, a GET or PUT request will return a 200 or 204 for success or a 404 for a note found. The other error codes, such as 401 and 500, should be handled in the application code.

This can be done by writing an Error Handler class that contains a method for each of the possible return codes.

In each method, specific actions can be taken to help the user understand why their request failed and how to correct it.

This could include displaying a friendly error message to the user or redirecting them to a different page.

Additionally, the appropriate logging can be used to track errors.

Pega connectors have built-in exception handling features that enable developers to quickly and accurately identify and recover from errors that may occur while accessing external systems. The exception handling features should cover the following scenarios: 1. Connection and Authentication Failure: The connection and authentication related exceptions that occur when attempting to access the remote system, due to wrong credentials or network errors. 2. Request Failure: Exceptions that occurs due to errors in the request payload that were send for processing by the remote system 3. Response Failure: Exceptions that come from the remote system when it is unable to process the request or when it receives invalid response data. 4. Downstream System Errors: Exceptions that result from errors in the downstream systems that are triggered by the connector, for example, a database connection error. 5. Timeouts and Latency: Exceptions that occur when the response time from the external system is greater than the timeout set by the connector.

No comments:

Post a Comment