diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-05-21 09:46:27 -0700 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-05-21 09:46:27 -0700 |
commit | c64cd113ccd16fa210f9ea2808deb044aadc8f61 (patch) | |
tree | 5cf61ae16d1dbd4066f9765afd157ff88f929f53 | |
parent | 75415663f84ac006c5a4d5a6896ece50c299c03e (diff) | |
download | gitlab-ce-c64cd113ccd16fa210f9ea2808deb044aadc8f61.tar.gz |
Add ! for verify_record! because it could raise
-rw-r--r-- | lib/gitlab/email/handler/base_handler.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/email/handler/create_issue_handler.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/email/handler/create_note_handler.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/email/handler/base_handler.rb b/lib/gitlab/email/handler/base_handler.rb index 230d13feea9..dcbad5bdb29 100644 --- a/lib/gitlab/email/handler/base_handler.rb +++ b/lib/gitlab/email/handler/base_handler.rb @@ -42,7 +42,7 @@ module Gitlab end.join end - def verify_record(record, exception, error_title) + def verify_record!(record, exception, error_title) return if record.persisted? msg = error_title + record.errors.full_messages.map do |error| diff --git a/lib/gitlab/email/handler/create_issue_handler.rb b/lib/gitlab/email/handler/create_issue_handler.rb index 259d74a83bf..cba8f2b61f6 100644 --- a/lib/gitlab/email/handler/create_issue_handler.rb +++ b/lib/gitlab/email/handler/create_issue_handler.rb @@ -12,7 +12,7 @@ module Gitlab def execute validate_permission!(:create_issue) - verify_record( + verify_record!( create_issue, InvalidIssueError, "The issue could not be created for the following reasons:" diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb index 7252906fd48..282f1844097 100644 --- a/lib/gitlab/email/handler/create_note_handler.rb +++ b/lib/gitlab/email/handler/create_note_handler.rb @@ -18,7 +18,7 @@ module Gitlab raise NoteableNotFoundError unless sent_notification.noteable raise EmptyEmailError if message.blank? - verify_record( + verify_record!( create_note, InvalidNoteError, "The comment could not be created for the following reasons:" |