Correct error message returned by ChangeService
Previously the string was spanning multiple lines and included a needless `\n` character in the resulting error message. This change also reduces duplication by assigning two variables.
This commit is contained in:
parent
2a450e2180
commit
cc12b57c3f
|
@ -24,8 +24,12 @@ module Commits
|
|||
start_project: @start_project,
|
||||
start_branch_name: @start_branch)
|
||||
rescue Gitlab::Git::Repository::CreateTreeError
|
||||
error_msg = "Sorry, we cannot #{action.to_s.dasherize} this #{@commit.change_type_title(current_user)} automatically.
|
||||
This #{@commit.change_type_title(current_user)} may already have been #{action.to_s.dasherize}ed, or a more recent commit may have updated some of its content."
|
||||
act = action.to_s.dasherize
|
||||
type = @commit.change_type_title(current_user)
|
||||
|
||||
error_msg = "Sorry, we cannot #{act} this #{type} automatically. " \
|
||||
"This #{type} may already have been #{act}ed, or a more recent " \
|
||||
"commit may have updated some of its content."
|
||||
raise ChangeError, error_msg
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue