So I have an API which is throwing a 422 response that I want to tell my user about, but I cannot make the error message I am defining on the Server Side come through to the Client Side.
Here is my server side code (I’m not sure if the Response should go in the Steps or Catch area, so I have it in both for now):
I’ve removed the quotes, but it is still the same response. Just to be sure I’m not going crazy I’ve checked the data I am displaying in red, which look okay to me…
Mine is an API rather than a database connection, so I’m wondering if that makes a difference, or whether I have uncovered a bug…
It looks like your response display is referencing the name of the api action in the server connect, however shouldn’t it reference the name of the app connect action on the front end? In other words, the response is what you should reference, not the output of the api action.
Checks if the user has been verified already, then checks to make sure they haven't requested a verification link within the last 2 minutes, then generates a hash and sends an email to the user with a link to verify their account.
Well that is true, except to say that actually the server connect, the server action and the api action are all called register_postmark_email.
I’d be interested to hear your views on that being the case… I believed that the only thing accessible on the front end is from the server connect so it wouldn’t be an issue.
I tried renaming the server connect to be sc_register_postmark_email and the problem persists.
I did get the API to produce a 503 error a short while ago and the error message for that came through, so I am a bit baffled as to what is going on.
Do these response items go in the Steps area or the Catch area, or doesn’t it matter?
I don’t think the naming is the issue, although I typically don’t use that naming convention.
My experience has been that when the response action step is used, it becomes the only output. However what you are showing with the object object, suggests that is coming from the api action – the text in the response properties is a simple text field.
If you in your testing saw the 503 and its description, while still having the 422 in the response action, that suggests you were looking at the result of the api, not the response.
I’d trim this all back to just the response action so you can see that it is properly making it to the front end.