diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /lib/gitlab/git/base_error.rb | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'lib/gitlab/git/base_error.rb')
-rw-r--r-- | lib/gitlab/git/base_error.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/git/base_error.rb b/lib/gitlab/git/base_error.rb new file mode 100644 index 00000000000..a7eaa82b347 --- /dev/null +++ b/lib/gitlab/git/base_error.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Gitlab + module Git + class BaseError < StandardError + DEBUG_ERROR_STRING_REGEX = /(.*?) debug_error_string:.*$/m.freeze + + def initialize(msg = nil) + if msg + raw_message = msg.to_s + match = DEBUG_ERROR_STRING_REGEX.match(raw_message) + raw_message = match[1] if match + + super(raw_message) + else + super + end + end + end + end +end |