ForestAdmin / agent-nodejs

🌱 Node.js agent for Forest Admin
GNU General Public License v3.0
67 stars 8 forks source link

Meaningful error messages if InternalServerError is thrown #383

Closed AndrejGajdos closed 2 years ago

AndrejGajdos commented 2 years ago

Why do you set Unexpected error when InternalServerError is thrown?

Right now, the actual error messages are not passed to forestadmin.

For example if a record cannot be deleted I can see in console.log:

Screenshot 2022-08-18 at 17 01 03

In ForestAdmin you get Unexpected error and this error message is not very useful.

Screenshot 2022-08-18 at 15 58 25
jeffladiray commented 2 years ago

Hey @AndrejGajdos :wave:

This was initially done deliberately to prevent leaking informations from the database.

However, we missed the fact that this kind of validation errors may be interesting from a frontend perspective. I'll open a ticket in our issue tracker to handle all these cases, and we will keep you updated on the resolution 👍

romain-gilliotte commented 2 years ago

Hi @AndrejGajdos

As said by @jeffladiray, we can't merge your contribution, because we're afraid to leak internal information to users that may be contained in unhandled errors.

I've been assigned to the ticket. How about this?

AndrejGajdos commented 2 years ago

@romain-gilliotte this is great, thanks!

romain-gilliotte commented 2 years ago

The three PRs have been merged, so I'm closing this issue