Commit 10aefd36 authored by allison.browne's avatar allison.browne

CR feedback changes

parent 2b302363
...@@ -34,7 +34,7 @@ module Sentry ...@@ -34,7 +34,7 @@ module Sentry
private private
def validate_size(issues) def validate_size(issues)
return if valid_size?(issues) return if Gitlab::Utils::DeepSize.new(issues).valid?
raise Client::ResponseInvalidSizeError, "Sentry API response is too big. Limit is #{Gitlab::Utils::DeepSize.human_default_max_size}." raise Client::ResponseInvalidSizeError, "Sentry API response is too big. Limit is #{Gitlab::Utils::DeepSize.human_default_max_size}."
end end
...@@ -101,7 +101,7 @@ module Sentry ...@@ -101,7 +101,7 @@ module Sentry
raise_error "Sentry response status code: #{response.code}" raise_error "Sentry response status code: #{response.code}"
end end
response response.parsed_response
end end
def raise_error(message) def raise_error(message)
......
...@@ -194,9 +194,10 @@ describe Sentry::Client do ...@@ -194,9 +194,10 @@ describe Sentry::Client do
context 'sentry api response too large' do context 'sentry api response too large' do
it 'raises exception' do it 'raises exception' do
allow(client).to receive(:valid_size?).and_return(false) deep_size = double('Gitlab::Utils::DeepSize', valid?: false)
allow(Gitlab::Utils::DeepSize).to receive(:new).with(sentry_api_response).and_return(deep_size)
expect { subject }.to raise_error(Sentry::Client::ResponseInvalidSizeError, "Sentry API response is too big. Limit is #{Gitlab::Utils::DeepSize.human_default_max_size}.") expect { subject }.to raise_error(Sentry::Client::ResponseInvalidSizeError, 'Sentry API response is too big. Limit is 1 MB.')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment