Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Need help in extracting the backend error message in GCP Application Integration

Hello All,

I'm calling a backend api from GCP Application integration. And the backend application is throwing me a 400 error. In Application Integration logs, I could see below message as the error message in GCP Application Integration.

'HTTP Response Errors: 400 Bad Request Content-Type: application/vnd.oracle.adf.resourceitem+json Content-Length: 84 Referrer-Policy: origin X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Location: X-ORACLE-DMS-ECID: 006DMf7XOLtDCgT6yBvX6G00AUW^00083b X-ORACLE-DMS-RID: 0:5 Content-Encoding: gzip REST-Framework-Version: 1 X-XSS-Protection: 1; mode=block Pragma: no-cache Content-Language: en Strict-Transport-Security: max-age=31536000; includeSubDomains Date: Sun, 18 May 2025 15:36:32 GMT Connection: close Vary: Accept-Encoding AKGRN: 0.8cc3ce17.1747582589.2f493a90 Some dates in this absence overlap with another absence. (ANC-3405005)'


Here, I would to get the text highlighted red color is the error message from the backend and I would like to send only that error message to the client. I could not find a way to do this. Is there a way to do this. 

Is there way to extract error message from the backend from GCP Application Integration's error message?

0 2 254
2 REPLIES 2

Hi @venkatvenkatsiv,

To catch errors in GCP Application Integration, it is recommended to use both an error handling strategy and an error catcher. The error handling strategy can help you define how errors should be handled, and the error catcher will actually let you capture and manage the error.

You can also use system variables to capture things like the error code and the error message, which you can then pass to your error catcher flow. That way, you can isolate and send just the relevant part of the error message to the client.

I’d suggest checking out this example in the documentation to get a better understanding of how to set this up. It should give you a clear idea of how to implement this.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Hi @mcbsalceda  - Thanks for the reply.! 

I have tried the approach suggested by you.

This is my simple integration.

venkatvenkatsiv_0-1747878041414.png

I'm receiving the error in "Call REST Endpoint" task. So, I have added the error handling strategy and error catcher as suggested in the example. 

venkatvenkatsiv_1-1747878205766.png

The error is being catched by the mentioned error-catcher. In the error-catcher I tried to extract the System variable "ErrorInfo.message" using javascript policy. The value of the extracted variable is as below.

"'HTTP Response Errors: 400 Bad Request Content-Type: application/vnd.oracle.adf.resourceitem+json Content-Length: 84 Referrer-Policy: origin X-Content-Type-Options: nosniff Cache-Control: no-cache, no-store, must-revalidate Location: X-ORACLE-DMS-ECID: 006DQyAveDbDCgT6yBvX6G001fM30000bA X-ORACLE-DMS-RID: 0:5 Content-Encoding: gzip REST-Framework-Version: 1 X-XSS-Protection: 1; mode=block Pragma: no-cache Content-Language: en Strict-Transport-Security: max-age=31536000; includeSubDomains Date: Thu, 22 May 2025 01:38:47 GMT Connection: close Vary: Accept-Encoding AKGRN: 0.c4a6dc17.1747877925.1135a0f3 Some dates in this absence overlap with another absence. (ANC-3405005)'"


Is there a way to parse this message further. Because this message has some unwanted metadata along with backend's error message. The actual backend error message is Some dates in this absence overlap with another absence. (ANC-3405005). which is present at the end of the above error message extracted from the system variable. I only need the backend error message that I can send to the client.