If we have an enrich mediator in an API and add a filter mediator to capture the error codes of either 0 or 601000 which includes a Payload Factory mediator in the fault sequence of an API along with a property mediator which has HTTP_SC response code of 400 followed by a respond mediator we do not get the proper response and get 202 accepted.
However, if we add the same to an InSequence of an API we can see the expected response code 400 along with the error message.
Steps to Reproduce
Create an API with an inSequence and faultSequence.
Add an enrich mediator in the InSequence followed by a payloadFactory mediator to return an error message and property mediator to return an HTTP_SC error code such as 400.
Add a filter mediator and payloadFactory mediator in the fault sequence to filter error code 0 or 601000 followed by a payloadFactory mediator to return an error message and property mediator to return an HTTP_SC error code such as 400.
Invoke the above API with a valid JSON payload to invoke the inSequence flow. We will get the expected error code 400 and error message defined in the payloadFactory mediator.
Invoke the above API with an invalid JSON payload to invoke the fault sequence. We will get only 202 Accepted error code.
Description
If we have an enrich mediator in an API and add a filter mediator to capture the error codes of either 0 or 601000 which includes a Payload Factory mediator in the fault sequence of an API along with a property mediator which has HTTP_SC response code of 400 followed by a respond mediator we do not get the proper response and get 202 accepted.
However, if we add the same to an InSequence of an API we can see the expected response code 400 along with the error message.
Steps to Reproduce
Affected Version(s)
4.1.0
OS, DB, other environment details and versions
No response
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response