Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-05-23 20:19:20 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-05-23 20:23:07 +0300
commit1f5d55907a05fefbda17f7a4f45f58f2b522aee2 (patch)
treebae95bb6397663ee0d2144856b435a4908ea6033 /lib/gitlab/email/handler
parent863d8e5ae55debc08bf095354aee0a63417624fc (diff)
Merge the places where exceptions could be raised
Diffstat (limited to 'lib/gitlab/email/handler')
-rw-r--r--lib/gitlab/email/handler/create_issue_handler.rb3
-rw-r--r--lib/gitlab/email/handler/create_note_handler.rb3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/email/handler/create_issue_handler.rb b/lib/gitlab/email/handler/create_issue_handler.rb
index 7e3506bbd3f..bfc56cb17ff 100644
--- a/lib/gitlab/email/handler/create_issue_handler.rb
+++ b/lib/gitlab/email/handler/create_issue_handler.rb
@@ -14,10 +14,11 @@ module Gitlab
end
def can_handle?
- !!(project_namespace && project)
+ !!authentication_token
end
def execute
+ raise ProjectNotFound unless project
validate_permission!(:create_issue)
verify_record!(
diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb
index b91dd623161..2ae3bf23a74 100644
--- a/lib/gitlab/email/handler/create_note_handler.rb
+++ b/lib/gitlab/email/handler/create_note_handler.rb
@@ -6,7 +6,8 @@ module Gitlab
module Handler
class CreateNoteHandler < BaseHandler
def can_handle?
- !!(mail_key && sent_notification)
+ # We want to raise SentNotificationNotFoundError for missing key
+ !!(mail_key.nil? || mail_key =~ /\A\w+\z/)
end
def execute