diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-06-20 14:11:42 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-06-20 14:11:42 +0300 |
commit | 0671db52a8152ad6d0c4104fa5fc437b9fd6c69d (patch) | |
tree | 3e1027f72d054d55777bd07c6828e5890ccee118 /lib/gitlab/email/handler/base_handler.rb | |
parent | c491f66952dd440c449c966727f9f08f3247e9d3 (diff) |
Use keyword args to be more clear:
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3363#note_12566374
Diffstat (limited to 'lib/gitlab/email/handler/base_handler.rb')
-rw-r--r-- | lib/gitlab/email/handler/base_handler.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/gitlab/email/handler/base_handler.rb b/lib/gitlab/email/handler/base_handler.rb index 1691fca6465..b7ed11cb638 100644 --- a/lib/gitlab/email/handler/base_handler.rb +++ b/lib/gitlab/email/handler/base_handler.rb @@ -43,17 +43,16 @@ module Gitlab end.join end - def verify_record!(record, exception, name) + def verify_record!(record:, invalid_exception:, record_name:) return if record.persisted? - error_title = - "The #{name} could not be created for the following reasons:" + error_title = "The #{record_name} could not be created for the following reasons:" msg = error_title + record.errors.full_messages.map do |error| "\n\n- #{error}" end.join - raise exception, msg + raise invalid_exception, msg end end end |