(EASY) add custom rollbar log for OAuth2 error
rollbar gem doc: https://docs.rollbar.com/docs/ruby#section-usage rails logging: https://stackoverflow.com/questions/3484337/rails-logging-the-entire-stack-trace-of-an-exception
rescue_from OAuth2::Error do |_exception|
# add error log here
session[:user_id] = nil
redirect_to root_path, alert: I18n.t(:login_error)
end
We are quite often getting OAuth2 which for user looks like this: but we can't really track it in logs or rollbar since it is not reported anywhere. We should add rollbar and / or rails log with proper info so that we could track that errors and fix it in the future.
Edited by Wojciech Zakrzewski