Commit 7f039c3f authored by Robert May's avatar Robert May

Update to remove unsafe error propagation

parent 3698d027
......@@ -90,7 +90,7 @@ module MergeRequests
repository.merge(current_user, source, merge_request, commit_message)
rescue Gitlab::Git::PreReceiveError => e
raise MergeError,
"GL-HOOK-ERR: Something went wrong during merge pre-receive hook. #{e.message}".strip
"Something went wrong during merge pre-receive hook. #{e.message}".strip
rescue => e
handle_merge_error(log_message: e.message)
raise_error('Something went wrong during merge')
......
......@@ -179,7 +179,7 @@ module Gitlab
)
if response.pre_receive_error.present?
raise Gitlab::Git::PreReceiveError.new("GL-HOOK-ERR: pre-receive hook failed: #{response.pre_receive_error}")
raise Gitlab::Git::PreReceiveError.new("GL-HOOK-ERR: pre-receive hook failed.")
end
Gitlab::Git::OperationService::BranchUpdate.from_gitaly(response.branch_update)
......
......@@ -202,7 +202,7 @@ RSpec.describe Gitlab::GitalyClient::OperationService do
it "raises the error" do
# the PreReceiveError class strips the GL-HOOK-ERR prefix from this error
expect { subject }.to raise_error(Gitlab::Git::PreReceiveError, "pre-receive hook failed: pre-receive hook error message")
expect { subject }.to raise_error(Gitlab::Git::PreReceiveError, "pre-receive hook failed.")
end
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