diff options
Diffstat (limited to 'lib/sentry')
-rw-r--r-- | lib/sentry/client.rb | 15 | ||||
-rw-r--r-- | lib/sentry/client/issue.rb | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/sentry/client.rb b/lib/sentry/client.rb index 65bedbf9e0f..211c828ccc3 100644 --- a/lib/sentry/client.rb +++ b/lib/sentry/client.rb @@ -71,9 +71,22 @@ module Sentry end def http_get(url, params = {}) - response = handle_request_exceptions do + http_request do Gitlab::HTTP.get(url, **request_params.merge(params)) end + end + + def http_put(url, params = {}) + http_request do + Gitlab::HTTP.put(url, **request_params.merge({ body: params })) + end + end + + def http_request + response = handle_request_exceptions do + yield + end + handle_response(response) end diff --git a/lib/sentry/client/issue.rb b/lib/sentry/client/issue.rb index 28e87ab18a1..4a11c87faa4 100644 --- a/lib/sentry/client/issue.rb +++ b/lib/sentry/client/issue.rb @@ -15,6 +15,10 @@ module Sentry http_get(issue_api_url(issue_id))[:body] end + def update_issue(issue_id:, params:) + http_put(issue_api_url(issue_id), params)[:body] + end + def issue_api_url(issue_id) issue_url = URI(url) issue_url.path = "/api/0/issues/#{CGI.escape(issue_id.to_s)}/" |