-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Please try understanding the severity of this issue for running Strapi in production.
Bug report
Required System information
Node.js version: 16.14.2
NPM version: 8.5.0
Strapi version: 4.6.0
Database: Postgres
Operating system: Ubuntu 20.04
Describe the bug
Currently, wherever API data is checked 'manually' and not through the validation mechanism, the default behaviour is throwing a server error. A small excerpt:
This leads to two problems:
-
How is a frontend supposed to know what the issue with some user's input is, if the only reply is a 500 server error? Is it a bug in the code my client's users should report to us, or was there just some issue with a wrong password?
-
If you throw an error right away every time some user enters a wrong password, your event monitoring tool will look like this and it's impossible to filter out real issues:
Expected behaviour
No errors thrown when there isn't actually something failing. The correct thing to do here is a proper HTTP response, ideally formatted the same way as the regular validation errors.
Come on guys, I see the amount of hard work you've put in this awesome project, don't let bad execution of basic practices overshadow all the hard effort. 🙏

