Saturday 3 June 2017

Loopback 3 discards error information on multiple validation errors, turning 422 to 500, how can I solve that?

I'm migrating from Loopback 2 tot 3.

I currently have an issue with validation errors and strong-error-handler

When I post a bulk create which results in multiple validation errors, those get returned as an array of ValidationErrors. Those errors get grouped by strong-error handler in a 500 internal server error, which is how it was before, but the details of the errors get discarded, when debug is set to false.

In my example I upload an array of tags, but for each tag, a uniqueness validation is executed. When 2 or more tags are already in the database, I have an array of errors, instead of a single validation error

I need a way to determine why the validation failed on the client side, but the details of the errors are discarded now.

Am I doing something wrong here, or should this be considered as a bug?



via Ernie

No comments:

Post a Comment