ng-token-auth icon indicating copy to clipboard operation
ng-token-auth copied to clipboard

Duplicate Email during update - get error message instead of stack trace

Open real-ashwin opened this issue 8 years ago • 0 comments

How to get an error message when email update fails because it exists already?

Currently, it throws exception and I cant figure out where to rescue to return an error message to the client. The error message looks like 👍

PG::UniqueViolation at /auth
============================

> ERROR:  duplicate key value violates unique constraint "index_users_on_uid_and_provider"
DETAIL:  Key (uid, provider)=([email protected], email) already exists.


activerecord (4.2.1) lib/active_record/connection_adapters/postgresql_adapter.rb, line 602
------------------------------------------------------------------------------------------
...
...

real-ashwin avatar Jul 21 '16 06:07 real-ashwin