Render HTML response with error code

Hi Team,
Is there a way to render HTML response with error notification?
I have tried the below code

  render status: 400, json: {  html: 
<<EOF
#{error_message}
EOF
}

in which error_message contains the html content in string format.

I am getting Bad Request Error.

Please help me out!

Regards,
Ajith Mani
Project Name: PlutusAdmin

Hi @ajithmani,

Please confirm that I understand your request:

  • Forestadmin frontend requests your server (to fetch some data, for example)
  • Then an error occurs on the server producing some HTML code in the response body
  • Then the HTML fragment should be displayed on the Forestadmin UI.

Is that what you need?
If yes, I am afraid we do not have such a feature today. Only a string message is used.

Regards

HI @Sliman_Medini,
No, that is not my request.
I want to render a HTML response along with error notification instead of success notification.

In the above response, instead of showing “Bulk Upload Coupon Rate action successful” in success (green coloured) notification, I want to show “Bulk Upload Coupon Rate action failed” in error (red coloured) notification (like mentioned in this page custom-error-notification)

To be clear, the “error_message” string has my customised HTML response (not an internal server error), which is working fine.
Only thing I want to change is the notification type.

Regards,
Ajith Mani.V
Project: PlutusAdmin.

Hi @ajithmani,

Ok,
You are right, HTML responses are well handled now, but it’s for success details only, sorry.
To display error details, only the toaster is available for the moment.

I am creating a product ticket in order to have an HTML error notification that is working as an HTML success notification.

Regards,

Fine @Sliman_Medini.
Thank You for considering our request.

Regards,
Ajith mani