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/bitbucket_server')
-rw-r--r--lib/bitbucket_server/connection.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/bitbucket_server/connection.rb b/lib/bitbucket_server/connection.rb
index 0e7817fc82e..853d09b776a 100644
--- a/lib/bitbucket_server/connection.rb
+++ b/lib/bitbucket_server/connection.rb
@@ -33,22 +33,22 @@ module BitbucketServer
check_errors!(response)
- response
+ response.parsed_response
end
private
def check_errors!(response)
- if response.code != 200
- error =
- if response.parsed_response && response.parsed_response.is_a?(Hash)
- sanitize(response.parsed_response.dig('errors', 0, 'message'))
- end
-
- message = "Error #{response.code}"
- message += ": #{error}" if error
- raise ConnectionError, message
- end
+ return if response.code == 200
+
+ details =
+ if response.parsed_response && response.parsed_response.is_a?(Hash)
+ sanitize(response.parsed_response.dig('errors', 0, 'message'))
+ end
+
+ message = "Error #{response.code}"
+ message += ": #{details}" if details
+ raise ConnectionError, message
end
def auth