Commit 2f78b5e8 authored by Douwe Maan's avatar Douwe Maan

Make error class names more consistent.

parent 0b401f2e
......@@ -22,7 +22,7 @@ class EmailReceiverWorker
reason = nil
case e
when Gitlab::Email::Receiver::SentNotificationNotFound
when Gitlab::Email::Receiver::SentNotificationNotFoundError
reason = "We couldn't figure out what the email is in reply to. Please create your comment through the web interface."
when Gitlab::Email::Receiver::EmptyEmailError
can_retry = true
......@@ -35,7 +35,7 @@ class EmailReceiverWorker
reason = "You are not allowed to respond to the thread you are replying to. If you believe this is in error, contact a staff member."
when Gitlab::Email::Receiver::NoteableNotFoundError
reason = "The thread you are replying to no longer exists, perhaps it was deleted? If you believe this is in error, contact a staff member."
when Gitlab::Email::Receiver::InvalidNote
when Gitlab::Email::Receiver::InvalidNoteError
can_retry = true
reason = e.message
else
......
......@@ -4,13 +4,13 @@ module Gitlab
class Receiver
class ProcessingError < StandardError; end
class EmailUnparsableError < ProcessingError; end
class SentNotificationNotFoundError < ProcessingError; end
class EmptyEmailError < ProcessingError; end
class AutoGeneratedEmailError < ProcessingError; end
class UserNotFoundError < ProcessingError; end
class UserNotAuthorizedError < ProcessingError; end
class NoteableNotFoundError < ProcessingError; end
class AutoGeneratedEmailError < ProcessingError; end
class SentNotificationNotFound < ProcessingError; end
class InvalidNote < ProcessingError; end
class InvalidNoteError < ProcessingError; end
def initialize(raw)
@raw = raw
......@@ -23,7 +23,7 @@ module Gitlab
end
def execute
raise SentNotificationNotFound unless sent_notification
raise SentNotificationNotFoundError unless sent_notification
raise EmptyEmailError if @raw.blank?
......@@ -53,7 +53,7 @@ module Gitlab
message << "\n\n- #{error}"
end
raise InvalidNote, message
raise InvalidNoteError, message
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment