Commit 0b067cf1d343080e98a84739ed2cee8526432309
1 parent
9e89e39e
Exists in
master
and in
22 other branches
Handle ActiveRecord::RecordInvalid exceptions in remote user plugin
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
plugins/remote_user/lib/remote_user_plugin.rb
| @@ -48,8 +48,11 @@ class RemoteUserPlugin < Noosfero::Plugin | @@ -48,8 +48,11 @@ class RemoteUserPlugin < Noosfero::Plugin | ||
| 48 | end | 48 | end |
| 49 | end | 49 | end |
| 50 | end | 50 | end |
| 51 | + rescue ::ActiveRecord::RecordInvalid | ||
| 52 | + session[:notice] = _('Could not create the remote user.') | ||
| 53 | + render_404 | ||
| 51 | rescue | 54 | rescue |
| 52 | - session[:notice] = _('Could not create the remote_user.') | 55 | + session[:notice] = _("Could not log in.") |
| 53 | render_404 | 56 | render_404 |
| 54 | end | 57 | end |
| 55 | end | 58 | end |