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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7f039c3f
Commit
7f039c3f
authored
Jul 02, 2020
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to remove unsafe error propagation
parent
3698d027
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+1
-1
lib/gitlab/gitaly_client/operation_service.rb
lib/gitlab/gitaly_client/operation_service.rb
+1
-1
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
+1
-1
No files found.
app/services/merge_requests/merge_service.rb
View file @
7f039c3f
...
...
@@ -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'
)
...
...
lib/gitlab/gitaly_client/operation_service.rb
View file @
7f039c3f
...
...
@@ -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
)
...
...
spec/lib/gitlab/gitaly_client/operation_service_spec.rb
View file @
7f039c3f
...
...
@@ -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
...
...
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