diff options
author | Luke Duncalfe <lduncalfe@eml.cc> | 2019-03-20 17:08:51 +1300 |
---|---|---|
committer | Luke Duncalfe <lduncalfe@eml.cc> | 2019-03-26 13:05:40 +1300 |
commit | f82380b9df9693e7976b7474233840a469635429 (patch) | |
tree | 0b692684c7b5933d3df6076ec5b9c9e772dd6a50 /app/services | |
parent | a3b3da72775fd37f7533ddd88fe47600079b4ed9 (diff) | |
download | gitlab-ce-f82380b9df9693e7976b7474233840a469635429.tar.gz |
Allow custom hooks errors to appear in GitLab UI
Error messages from custom pre-receive hooks now appear in the GitLab
UI.
This is re-enabling a feature that had been disabled in merge request
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18646
The feature had been disabled due to security concerns that information
which was not intended to be public (like stack traces) would leak into
public view.
PreReceiveErrors (from pre-receive, post-receive and update custom
hooks) are now filtered for messages that have been prefixed in a
particular way.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48132
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/merge_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index 8241e408ce5..d8a78001b79 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -76,8 +76,8 @@ module MergeRequests def try_merge repository.merge(current_user, source, merge_request, commit_message) rescue Gitlab::Git::PreReceiveError => e - handle_merge_error(log_message: e.message) - raise_error('Something went wrong during merge pre-receive hook') + raise MergeError, + "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') |