Hi there,
It seems i’ve the same issue as described here : HTTP node - Response Format JSON ➝ response with empty body ➝ no output - #5 by antitalent
When an HTTP node get an Error, the error message is unusable, it is not the error message my API is sending. It’s come with a lot of “axios things” and i cant parse message error.
"error":
{
"message":
"400 - "{\"errorCode\":400,\"message\":\"WRONG_SEALINE\",\"details\":[\"Invalid carrier alpha code (SCAC) specified\"],\"time\":\"2024-02-22T15:12:24.286266028Z\"}"",
"name":
"AxiosError",
Is there a way to just get the error my API is sending instead of all this axios syntax ?
I use the “continue (using error output)” option because i need to send the error to my front end (webhook/respond to webhook dynamics)
Thanks
n8n
February 22, 2024, 5:29pm
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
n8n version:
Database (default: SQLite):
n8n EXECUTIONS_PROCESS setting (default: own, main):
Running n8n via (Docker, npm, n8n cloud, desktop app):
Operating system:
Jon
February 23, 2024, 8:20am
3
Hey @dubarseo ,
The error from the API is in the message so in theory you could use error.message
and remove the status code then convert the rest to json.
1 Like
Thanks for your help
How to remove status code and convert the rest to JSON ?
Jon
February 23, 2024, 4:17pm
5
Hey @dubarseo ,
Quickest I can think of would be a replace or slice to remove the first part then use the JSON.parse() javascript method.
1 Like
system
Closed
May 23, 2024, 4:17pm
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.