Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]:Error code and Error message is not returned as expected in API Fault Sequence #3596

Closed
VinulaUthsara opened this issue Sep 9, 2024 · 0 comments · Fixed by wso2/wso2-synapse#2220
Labels

Comments

@VinulaUthsara
Copy link

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

  1. Create an API with an inSequence and faultSequence.
  2. 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.
  3. 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.
  4. 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.
  5. Invoke the above API with an invalid JSON payload to invoke the fault sequence. We will get only 202 Accepted error code.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant