appscot / sails-orientdb

OrientDB adapter for Waterline / Sails.js ORM
MIT License
25 stars 23 forks source link

Wrong error on unique constraint violation #128

Open mitom opened 9 years ago

mitom commented 9 years ago

If a unique constraint is violated an OrientDB.RequestError is thrown instead of WLValidationError as I'd expect. Actually it wouldn't have to be WLValidationError, but currently the error is of code E_UNKNOWN and that should be E_VALIDATION.

Error (E_UNKNOWN) :: Encountered an unexpected error
OrientDB.RequestError: Cannot index record user{******}: found duplicated key '*****@gmail.com' in index 'user.email' previously assigned to the record #15:2
dmarcelino commented 9 years ago

Thanks @mitom, we need to improve error handling in sails-orientdb.