Open tboily opened 3 years ago
@mtrezza I can't replicate this issue. user.email = 'alreadyInDb@test.com';
not sure how this works since a setter for this doesn't exist.
If two users are saved with identical email addresses, is that the error that is mentioned?
Yeah but using the example posted I can't get Unhandled Promise rejection
or the error.
If you just save two users with identical email addresses, do you get an Unhandled Promise rejection
error?
New Issue Checklist
Issue Description
If an error is thrown by Parse-Server on a Parse.User.save(), the SDK does not catch it and an Unhandled Promise Rejection error is raised, making it impossible for our app to catch the error.
There may be some sort of wrapper I am not aware of, but I gave a quick look to the code and to the untrained eye, it simply looks as though there is no try-catch block in the save() method of ParseUser (
src/ParseUser.js
). Same goes for other methods likedestroy()
.According to logs, error is raised at ParseObject.js:3137, but the absence of ParseUser in the error stack gives me the feeling it is indeed the culprit.
Steps to reproduce
In our case, we did as follows: Update a user with an email already used and call save().
Actual Outcome
Logs show an unhandled promise rejection, and nothing is caught in our catch block.
Expected Outcome
The SDK should catch the error and throw it back to the app.
Environment
nodejs 12.16.1 parse 3.3.0 parse-server 4.5.0
We were working with earlier versions of parse and parse-server before and updated to the latest versions to see if this error was fixed.
Server
4.5.0
Google App Engine (some version of Linux)
Google Cloud
Database
MongoDB
4.4.6
MongoDB Atlas
Client
3.3.0
Logs