Getting error description and code from the native service in APIGateway

Hello Team,

I have created a RESTful API in APIGateway which invokes a different service hosted in a separate webmethods EAI box.

Now when the service returns success, my API returns the payload correctly. But when it returns failure with HTTP codes 500 (say) although the response body is coming good with errorcode and error descr from the native service, the REST API is not able to forward the same.
Instead it gives a generic failure message:
Mediator encountered an error: Native service provider error. Code : 500 while executing operation
which is not explanatory to the caller system.

How to get the correct error code and error descr from the native service via API Gateway? Please suggest.


You need to add an error handling policy to your API. By default the API Gateway masks the native error response by with default message that you are seeing for security reasons.


Under transformation configuration, failure message ensure that you check the option for ‘Send Native Provider Fault Message’

Be careful this could potentially expose sensitive data, hence why it is disabled by default.

You can also change the default fault message from the Administrator menu → Administration → General → API Fault.

Product Manager
Integration & Microservice Runtime