You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My feathers server is returning a conflict error (when I try to create a new user with a primary key that already exists in the database)
Here is the error I have on the server:
error: (409) Route: /users - E11000 duplicate key error collection: printsServer.users index: email_1 dup key: { : "toto@yahoo.fr" }
info: Conflict: E11000 duplicate key error collection: printsServer.users index: email_1 dup key: { : "toto@yahoo.fr" }
at Conflict.ExtendableBuiltin (C:\Development\feathers\prints-server\node_modules\feathers-errors\lib\index.js:21:28)
at Conflict.FeathersError (C:\Development\feathers\prints-server\node_modules\feathers-errors\lib\index.js:99:87)
at new Conflict (C:\Development\feathers\prints-server\node_modules\feathers-errors\lib\index.js:236:77)
at errorHandler (C:\Development\feathers\prints-server\node_modules\feathers-mongoose\lib\error-handler.js:34:27)
at run (C:\Development\feathers\prints-server\node_modules\core-js\modules\es6.promise.js:87:22)
at C:\Development\feathers\prints-server\node_modules\core-js\modules\es6.promise.js:100:28
at flush (C:\Development\feathers\prints-server\node_modules\core-js\modules\_microtask.js:18:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
However, when I catch the error in my react-native app with the following code:
this.app.service('users').create(userData).then((result) => {
... do my stuff here
}).catch((err) => {
console.log('err');
console.log(err);
});
here is the error message I catch (in the console):
Does anyone knows how I can obtain in my react-native app an error message that is usable (that inform me on the actual error, like on the server, and that I can parse and convert to an error message understandable to the user (like: "an account with this email already exists"))
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.
lockbot
locked as resolved and limited conversation to collaborators
Feb 7, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My feathers server is returning a conflict error (when I try to create a new user with a primary key that already exists in the database)
Here is the error I have on the server:
However, when I catch the error in my react-native app with the following code:
here is the error message I catch (in the console):
Does anyone knows how I can obtain in my react-native app an error message that is usable (that inform me on the actual error, like on the server, and that I can parse and convert to an error message understandable to the user (like: "an account with this email already exists"))
The text was updated successfully, but these errors were encountered: