Improve the `Gitlab::OAuth::User` error message

The error saving the user is logged to application.log. Previously,
the entry had no context and was unusable - 'Error saving user:
[Email address already taken]'. Adding the auth hash UID and email
makes the error more helpful.
This commit is contained in:
Drew Blessing 2016-11-30 11:23:04 -06:00
parent d48787a233
commit 374033fe26
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ module Gitlab
log.info "(#{provider}) saving user #{auth_hash.email} from login with extern_uid => #{auth_hash.uid}"
gl_user
rescue ActiveRecord::RecordInvalid => e
log.info "(#{provider}) Error saving user: #{gl_user.errors.full_messages}"
log.info "(#{provider}) Error saving user #{auth_hash.uid} (#{auth_hash.email}): #{gl_user.errors.full_messages}"
return self, e.record.errors
end