Problems Using Catch/Response for an API

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):

422-2

And here is what I get back on the client side:

So I am clearly creating a 422 error, but the message is always just “422” and not the message I am setting in my response action step…

And I’m not sure what the response field of the Last Error should contain… would that contain the response from the API, so this JSON…?

422-3

Is there something sensible I can do to capture the “Message” field of error response and show it to the user?

Best wishes,
Antony.

PS - so if I then want further Server Action steps to only occur if the response is 200, how do I specify that in a condition? :thinking:

Community Page
Last updated: