Agree here. While I have a love/hate relationship with API's that use this pattern, Slack is a prime example of that.
Original Message:
Sent: 04-02-2025 23:52
From: Vaun McCarthy
Subject: Return error Message on output contracts
What you'll want to do is have your developer that looks after that API return a 200 ok for every query and include the response/error in an actual JSON object/string.
------------------------------
Vaun McCarthy
Original Message:
Sent: 04-02-2025 11:27
From: Samara Silva
Subject: Return error Message on output contracts
I need to return the error message or status code to an output contract so I can flag the type of error on Architecht for future reports.
For example: I send the get request with a ID that exists and the data action returns the fields I need. But when I send an ID that does ot have any register, the data action fails to execute instead of returning the error message as I configured, so I can know if was a 404, 500...

Here's how I expecting to treat return the errorMessage on the successTemplate:
{
"translationMap": {
"errorMessage": "$.message",
"lineOfBusinessNames": "concat($[*].lineOfBusinessName)"
},
"translationMapDefaults": {
"errorMessage": ""
},
"successTemplate": "{ \"lineOfBusinessNames\": ${lineOfBusinessNames}, \"errorMessage\": \"${errorMessage}\" }"
}
Is this a normal behavior of Data Actions and I can't do what i'm expecting, or is there a way to solve this?
#DataActions
------------------------------
Samara Silva
------------------------------