Show error in orange error popup using smart action route

It seems I can’t show the text I want when I want to throw an error message when using a smart action.

Here is my code :

And here is what I get in return :

Any hint ? Thanks.

Hello @XavierColombel,

Sorry but this is not possible at the moment. I shared your feedback with the product team, and I’ll let you know when this is included in the app.

In the mean time, your particular issue could be handled with this snippet:

router.post(
  '/actions/total-expected-payout',
  permissionMiddlewareCreator.smartAction(),
  (request, response) => {
    if (process.env.NODE_ENV !== 'production') {
      return response.status(400).send({ error: 'Erreur 403: Cette action doit être effectuée en production uniquement' });
    } else {
      // ...
    }
});

Hope this helps,

1 Like

Good job, thank you !

1 Like