Custom Error Message from throwError Not Displayed in UI

Feature(s) impacted

Custom Error Message from throwError is not Displayed in UI.

In a smart action code, we’re calling ctx.throwErrorwith an error message to run a business validation on form change.

We can see our error message in the server logs, but the the Forest UI shows a generic error.

Observed behavior

Custom Error Message from throwError is not Displayed in UI

Expected behavior

Custom Error Message from throwError is Displayed in UI

Failure Logs

-

Context

  • Agent technology: (nodejs)
  • Agent (forest package) name & version (from your .lock file): @forestadmin/agent 1.65.0

Additional Info

Initially, I had followed up on this thread (@vince), which seemed extremely relevant to the issue. However, since I didn’t receive a reply and assuming that old threads are not monitored, I’m taking the liberty of posting my question here as well in a new thread.

Thank you for a follow-up.
Matteo

Hello @Matteo,

I’ll try to help you out, do you have a rough idea the last time this worked ?

I do reproduce, I am currently looking into detecting when this regression was introduced.

I’ll keep you updated.

Best regards,

Looking back in our changes and the fact that there are error messages for each kind of potential loading issues on that API call, leads me to believe that this never was supported → custom error message on smart action change/load hook.

I’ll see how we can address your request.

1 Like

Hi @dogan.ay
Thank you for your support.

To be honest, I’m not sure it ever worked. :sweat_smile:

With the old agent, there were load/change hooks that seemed to work, as far as I remember. But after we rewrote everything on our side last year to move to the new agent, I’m not sure whether this feature in particular has ever worked there.

For this reason, I’m afraid I can’t be of much help in determining whether it’s a regression or, if so, when it was introduced.

Thank you,
Matteo

Hello @Matteo,

We decided to add support for this, the “feature” should be live on production if you refresh your page.

Best regards,

1 Like

So… it’s not a bug, it’s a feature :slight_smile:
That puts you in very good company - pure Linus Torvalds style (and yes, that’s a compliment).

Thanks a lot for the quick intervention! I confirm now it’s ok :+1:
Matteo

2 Likes

Haha :smiley:, thanks for the compliment !
This really wasn’t much so it was a no brainer as to enable this use-case.

We’re happy to make your experience as enjoyable as possible using and developing on Forest Admin.