DEV: Log env on error when looking up user in message_bus. (#13208)

This will provide more information about the request and make the error
debuggable.
This commit is contained in:
Alan Guo Xiang Tan 2021-06-01 09:15:26 +08:00 committed by GitHub
parent 6879655455
commit 62399ca387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,9 @@ def setup_message_bus_env(env)
extra_headers['Set-Cookie'] = '_t=del; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT'
end
rescue => e
Discourse.warn_exception(e, message: "Unexpected error in Message Bus")
Discourse.warn_exception(e, message: "Unexpected error in Message Bus", env: env)
end
user_id = user && user.id
raise Discourse::InvalidAccess if !user_id && SiteSetting.login_required