mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 10:33:38 +08:00
Log RecordInvalid when verbose_sso_logging enabled
This commit is contained in:
parent
99e88ce39f
commit
e265b7b090
|
@ -126,6 +126,14 @@ class SessionController < ApplicationController
|
|||
render text: I18n.t("sso.not_found"), status: 500
|
||||
end
|
||||
rescue ActiveRecord::RecordInvalid => e
|
||||
if SiteSetting.verbose_sso_logging
|
||||
Rails.logger.warn(<<-EOF)
|
||||
Verbose SSO log: Record was invalid: #{e.record.class.name} #{e.record.id}\n
|
||||
#{e.record.errors.to_h}\n
|
||||
\n
|
||||
#{sso.diagnostics}
|
||||
EOF
|
||||
end
|
||||
render text: I18n.t("sso.unknown_error"), status: 500
|
||||
rescue => e
|
||||
message = "Failed to create or lookup user: #{e}."
|
||||
|
|
Loading…
Reference in New Issue
Block a user