From db5966883ef1c801781edb67784f32be56b75389 Mon Sep 17 00:00:00 2001 From: cfritschi Date: Thu, 15 Jul 2021 17:56:53 +0200 Subject: [PATCH] Update request_client.rb To improve the error handling I suggest this change. In my case I just got "request_client.rb:16:in `request': Bad Request (JIRA::HTTPError)" with the existing code. --- lib/jira/request_client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jira/request_client.rb b/lib/jira/request_client.rb index d90ae9d6..2b5a3293 100644 --- a/lib/jira/request_client.rb +++ b/lib/jira/request_client.rb @@ -16,7 +16,7 @@ def request(*args) def request_multipart(*args) response = make_multipart_request(*args) - raise HTTPError, response unless response.is_a?(Net::HTTPSuccess) + raise HttpError.new(response.code, response.message), response unless response.is_a?(Net::HTTPSuccess) response end @@ -28,4 +28,4 @@ def make_multipart_request(*args) raise NotImplementedError end end -end \ No newline at end of file +end