Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git/base_error.rb')
-rw-r--r--lib/gitlab/git/base_error.rb21
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