Add ! for verify_record! because it could raise
This commit is contained in:
parent
75415663f8
commit
c64cd113cc
3 changed files with 3 additions and 3 deletions
|
@ -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|
|
||||
|
|
|
@ -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:"
|
||||
|
|
|
@ -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:"
|
||||
|
|
Loading…
Reference in a new issue