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
I think server side errors are 500s by default to limit information exposure, but you can overwrite this behaviour in SimpleSchema by using the transform hook to allow it:
@coagmano : I already tried to include this on server startup without success. It seems the Error is not processed by SimpleSchema. As you can see in my example, my method ends up with an exception coming directly from npm-mongo library.
schema is defined in app/imports/api/groups/groups.js
the methods called are createGroup and updateGroup from app/imports/api/groups/methods.js
there are unit tests in app/imports/api/groups/server/groups.tests.js (you can search for E11000 duplicate key).
I currently use unique index on a field in an application
When inserting or updating in the table with an already existing name, I don't get a [40X] error with details.
On the server, i get the following kind of error while updating
and while inserting
On client side this results in a 500 internal error with no details
I see in collection2 code that these kind of errors should result in Meteor.Error with error 409, this doesn't seem to be the case.
I upgraded to these versions before reporting this
meteor version 1.9.0
simpl-schema 1.5.6
aldeed:collection2 3.0.6
aldeed:schema-index 3.0.0
Thanks for your work and time spent here
The text was updated successfully, but these errors were encountered: