Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
2f78b5e8
Commit
2f78b5e8
authored
9 years ago
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make error class names more consistent.
parent
0b401f2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/workers/email_receiver_worker.rb
app/workers/email_receiver_worker.rb
+2
-2
lib/gitlab/email/receiver.rb
lib/gitlab/email/receiver.rb
+5
-5
No files found.
app/workers/email_receiver_worker.rb
View file @
2f78b5e8
...
@@ -22,7 +22,7 @@ class EmailReceiverWorker
...
@@ -22,7 +22,7 @@ class EmailReceiverWorker
reason
=
nil
reason
=
nil
case
e
case
e
when
Gitlab
::
Email
::
Receiver
::
SentNotificationNotFound
when
Gitlab
::
Email
::
Receiver
::
SentNotificationNotFound
Error
reason
=
"We couldn't figure out what the email is in reply to. Please create your comment through the web interface."
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
when
Gitlab
::
Email
::
Receiver
::
EmptyEmailError
can_retry
=
true
can_retry
=
true
...
@@ -35,7 +35,7 @@ class EmailReceiverWorker
...
@@ -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."
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
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."
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
::
InvalidNote
Error
can_retry
=
true
can_retry
=
true
reason
=
e
.
message
reason
=
e
.
message
else
else
...
...
This diff is collapsed.
Click to expand it.
lib/gitlab/email/receiver.rb
View file @
2f78b5e8
...
@@ -4,13 +4,13 @@ module Gitlab
...
@@ -4,13 +4,13 @@ module Gitlab
class
Receiver
class
Receiver
class
ProcessingError
<
StandardError
;
end
class
ProcessingError
<
StandardError
;
end
class
EmailUnparsableError
<
ProcessingError
;
end
class
EmailUnparsableError
<
ProcessingError
;
end
class
SentNotificationNotFoundError
<
ProcessingError
;
end
class
EmptyEmailError
<
ProcessingError
;
end
class
EmptyEmailError
<
ProcessingError
;
end
class
AutoGeneratedEmailError
<
ProcessingError
;
end
class
UserNotFoundError
<
ProcessingError
;
end
class
UserNotFoundError
<
ProcessingError
;
end
class
UserNotAuthorizedError
<
ProcessingError
;
end
class
UserNotAuthorizedError
<
ProcessingError
;
end
class
NoteableNotFoundError
<
ProcessingError
;
end
class
NoteableNotFoundError
<
ProcessingError
;
end
class
AutoGeneratedEmailError
<
ProcessingError
;
end
class
InvalidNoteError
<
ProcessingError
;
end
class
SentNotificationNotFound
<
ProcessingError
;
end
class
InvalidNote
<
ProcessingError
;
end
def
initialize
(
raw
)
def
initialize
(
raw
)
@raw
=
raw
@raw
=
raw
...
@@ -23,7 +23,7 @@ module Gitlab
...
@@ -23,7 +23,7 @@ module Gitlab
end
end
def
execute
def
execute
raise
SentNotificationNotFound
unless
sent_notification
raise
SentNotificationNotFound
Error
unless
sent_notification
raise
EmptyEmailError
if
@raw
.
blank?
raise
EmptyEmailError
if
@raw
.
blank?
...
@@ -53,7 +53,7 @@ module Gitlab
...
@@ -53,7 +53,7 @@ module Gitlab
message
<<
"
\n\n
-
#{
error
}
"
message
<<
"
\n\n
-
#{
error
}
"
end
end
raise
InvalidNote
,
message
raise
InvalidNote
Error
,
message
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment