Smart Action error with html response

In some instances we need a smart action that returns some extra information when it fails. Currently it only seems possible to send a response with status 400 and a single error message.

Example (sending an error message with an inline screenshot):

return res.send({
      html: `${json.result.error}${img}`,
      error: 'Oops! Something went wrong...',
    });

Expected behavior

This should display an error flash message and display the HTML output like it does with success responses that contain HTML.

Actual behavior

It only shows the error flash message, and not the HTML output.

Hi @SvenSlijkoord :wave: thank you to use Forest Admin. Have you take a look at this in our documentation ?
https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#custom-html-response
I hope this should be help.

Hi @Arnaud_Moncel

Yes I understand you can return an HTML response, but it does not seem possible to do this when working with a 400 (error) status.

Unfortunately it’s not supported yet. I add an entry on our product board.