How can we return the error code as 800 in case of a service REST/Connect REST?

How can we return the error code as 800 in case of a service REST/Connect REST?

In Service Rest under each method response tab, you could have a custom when rule to determine when error code needs to be 800. Attached screen shot for referrence.

For Connect Rest error code logic will be defined from the source system integration team, you would want to discuss with them about the scenarios in which all you are expecting 800 error code.

1 Like

Hi @TanyaS58 : Regarding connectors, i align with the previous response form @Gunasekaran_Baskaran . It will be defined by the interface owner.

Even for a service defined in Pega, Can i check what is the actual use-case? Please note that 800 is not a standard HTTP code. In this case, i would recommend to manage this in the business logic to have your own attribute in the response to send business specific error codes and description. You can use a decision table to maintain the codes and messages.

Thanks.

Hi @Gunasekaran_Baskaran your explanation is what exactly i explained in my interview as well,however the interviewer asked from where can we set this 800 in the first place as pyHTTPResponseCode cant be 800 so here i need some help?

Hi @ArulDevan See this was an interview question,the interviewer asked that is there any way we can set the error response code as 800 for service rest i explained the same logic that @Gunasekaran_Baskaran stated above however he asked how will we get 800 in the first place?so that we can configure the steps later on in the Service Response Tab.

Hi @TanyaS58 : Thanks for the details.

I strongly recommend to give a try which will help to understand the implementation.

As stated earlier, 800 is not a valid HTTP status code. So it is more leaned to Business error codes. You can define your business logic to derive the error codes and descriptions. It should also be defined in your API contract.

Help to refer to OOTB examples like “pzTranslatePegaAPIErrorCodes”

Thanks.

Hi @ArulDevan i tried to search for this pzTranslatePegaAPIErrorCodes but i didnt get any result in pega,also can you please elaborate how can we configure this from business point of view?as in case of service rest ?