Spring Integration DSL access error body in error handling flow - error-handling

I’m not able to access the error body in my spring integration error handling flow
Message received from external system
Status: 400 Bad Request
Response body:
{
“title”: “record already exists”, “errorCode”: -1
}
Tried to access the response body but unable to do so
msg.getPayload().getCause(), (MesaagingException)msg.getPayload().getRootCause() doesn’t work either. Only able to retrieve the status.

Related

Why does get my response error message got truncated

I'm new to the WorldPay integration development.
I'm having difficulty when I am sending an authorization request from one of our applications and I got this response from the api .
Client error: POST https://try.access.worldpay.com/payments/authorizations resulted in a 400 Bad Request response: {"errorName":"bodyDoesNotMatchSchema","message":"The json body provided does not match the expected schema","validationE (truncated...)
My problem is I was unable to see the complete error message because the response has been truncated. Is there a way to prevent that issue?

Mulesoft error message propagation through deployed application

General explanation of the problem:
how can i get/log inside an application B, the error/exception message produced by an application A (error description and code are generated with a OnErrorPropagate). Application A is a Process API and B is an Experience Api both deployed on cloudHub.
More Details:
i have a Process API App. and a Experience API APP. deployed on CloudHub that retrieve client data from a DB.
.../getClient?client_Id=xxx
When inside the request the client_id params is not provided the below error message (generated inside an OnErrorPropagate) is shown
"message" : "bad request"
When a client call the Exp.API APP /getClient without the parameter, the PROCESS API APP (invoked by a flow inside the Exp.API implementation) respond with the above error message.... how can i retrieve this message in my Experience API Application?
If i try lo log the payload response (that should contain the error message) from an Experience API APP log, i always get an empty message.
So, is possible to pass an error message generated inside an OnErrorPropagate from an application (PROCESS API APP) to another app (EXPERIENCE API APP)?
All these applications are on cloudhub. Mulesoft 4
You can capture the the error response payload from the process API which will be present in the error object and set it as response for your experience API using this DW expression
#[output application/json --- error.exception.errorMessage.typedValue]
You should capture the payload response in the Experience API when you make the HTTP request to the Process API.

POST Error 500 Internal Application Error Xray

I am trying to import my cucumber test cases to Xray using postman but i receiving the error message:
{
"error": "Internal Application Error!"
}
I am using postman to do integration with Xray, I already can do a GET to get the test results, I can do a POST to update the status test case. I am trying now to import my cucumber test to Xray, I am sending in my request https://xray.cloud.xpand-it.com/api/v1/import/feature?projectKey=XXX and I am adding the file with .feature with my cucumber test, but when I click on Send I getting this response message:
{
"error": "Internal Application Error!"
}
Isn't a connection\autentication problem because I can do the other tasks that I mentioned. When I try without a file I got the message that is necessary a file, so I imagine that is a problem to read the file, but I am using the template of Xray documentation https://confluence.xpand-it.com/display/XRAYCLOUD/Importing+Cucumber+Tests+-+REST
and I am sending the file as multipart/form-data
Someone knows how can I solve this?
Thanks
Params= projectKey XXX
Authentication = Bearer Token correctly token
Headers= Content-Type, application/json
Body = form-data, file, .feature file with cucumber test
With support from Xray team, the problem was solved, I was choosing the file but not typing file in the key, this solved
https://i.stack.imgur.com/kYLOr.png

Mule: HTTP connector failing due to string payload

I am trying to make a rest call via the http connector. I build the payload as a string, then when I am trying to send it to the client, I am getting the following error:
org.mule.api.MessagingException: Error sending HTTP request. Message payload is of type: String
the string looks as follows:
{
"firstName": "Nathan4",
"lastName": "Tregillus",
"email": "ntregillus#solarcity.com"
}
at this time I am just confused. is there only one type of body I can send?
Since you do not show your config I would suspect that there is some problems your mule instance and the service you're consuming, or the remote endpoint is having trouble generating the response. So you can check your config:
Methods (POST or Get)
Path
config-ref
name

Mule CXF Web service error handling

This question is on Mule CXF error handling. I have a soap based web service basically this is a validation service that validates an incoming file and reports on any errors in the file. Once validation is unsuccessful i have a catch-exception-strategy which logs the error and sends a email to Prod support team. After validation is unsuccessful i need not call the subsequent steps in the flow. And only the logging and sending an email alert should happen. Shouldn't using a catch-exception-strategy solve the problem ( similar to a try/catch block in Java). But what i notice is the caller is sent a response back and subsequent flow steps are executed
In your catch exception strategy put an asynchronous flow and in that put your logger and smtp to send the mail ... I guess it will solve your problem ...
Since you will be using asynchronous flow response shouldn't be there ... Pls let me know if it solve your issue