Commit 93f6b911 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Rename error_with to error in CreateIssueService

parent 8e7b75b1
...@@ -10,11 +10,11 @@ module IncidentManagement ...@@ -10,11 +10,11 @@ module IncidentManagement
end end
def execute def execute
return error_with('setting disabled') unless incident_management_setting.create_issue? return error('setting disabled') unless incident_management_setting.create_issue?
return error_with('invalid alert') unless alert.valid? return error('invalid alert') unless alert.valid?
result = create_incident result = create_incident
return error_with(result.message, result.payload[:issue]) unless result.success? return error(result.message, result.payload[:issue]) unless result.success?
result result
end end
...@@ -62,7 +62,7 @@ module IncidentManagement ...@@ -62,7 +62,7 @@ module IncidentManagement
incident_management_setting.issue_template_content incident_management_setting.issue_template_content
end end
def error_with(message, issue = nil) def error(message, issue = nil)
log_error(%{Cannot create incident issue for "#{project.full_name}": #{message}}) log_error(%{Cannot create incident issue for "#{project.full_name}": #{message}})
ServiceResponse.error(payload: { issue: issue }, message: message) ServiceResponse.error(payload: { issue: issue }, message: message)
......
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