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 | 48 | end |
| 49 | 49 | end |
| 50 | 50 | end |
| 51 | + rescue ::ActiveRecord::RecordInvalid | |
| 52 | + session[:notice] = _('Could not create the remote user.') | |
| 53 | + render_404 | |
| 51 | 54 | rescue |
| 52 | - session[:notice] = _('Could not create the remote_user.') | |
| 55 | + session[:notice] = _("Could not log in.") | |
| 53 | 56 | render_404 |
| 54 | 57 | end |
| 55 | 58 | end | ... | ... |