From c64cd113ccd16fa210f9ea2808deb044aadc8f61 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Sat, 21 May 2016 09:46:27 -0700
Subject: [PATCH] Add ! for verify_record! because it could raise

---
 lib/gitlab/email/handler/base_handler.rb         | 2 +-
 lib/gitlab/email/handler/create_issue_handler.rb | 2 +-
 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:"
-- 
GitLab