-
-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch error and provide message #13115
Catch error and provide message #13115
Conversation
@mkllnk , can you please review the error above, and let me know if I'm on the right track? If so, I'll go ahead and add a spec (I think a spec request would be sufficient) |
rescue ActiveRecord::RecordNotUnique | ||
flash[:error] = t("devise.oidc.record_not_unique", uid: request.env["omniauth.auth"].uid) | ||
redirect_to admin_oidc_settings_path | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks right.
faa7abd
to
61d0df1
Compare
Oh, and a transaction block. Because the controller after hooks tried to update the DB which resulted in PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block Even for a small rescue statement, it's worth adding a spec. You never know what might not be working!
61d0df1
to
f6f1a00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
b6f40f1
to
13f5009
Compare
Hey @dacook, sorry - I'd need some guidance on how to connect an OFN account with Keycloak. I guess I have not been following this work closely enough 🙈 |
Ok :-) I think I've accidentally triggered the error 500 and then staged this PR and indeed, an error message is observed: I'm just not very sure how to select a different account, but at least now we get the warning, instead of the error 500 🎉 |
We could add that to the error message. You need to go to Keycloak and log out. Then try again so that you are prompted to log in again and you can choose the right account. |
What? Why?
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates