Correctly Handle JavaScript Error Messages
In the post about REST API Filtering we have getFilterBy method in BaseRepository that calls getSequelizeWhereClause function and returns result. The call is wrapped up in try…catch block, so when an error is thrown, it gets transformed into an API error and get re-thrown. The message from the original error is assigned to the API…