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

CR feedback changes

parent 2b302363
......@@ -34,7 +34,7 @@ module Sentry
private
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}."
end
......@@ -101,7 +101,7 @@ module Sentry
raise_error "Sentry response status code: #{response.code}"
end
response
response.parsed_response
end
def raise_error(message)
......
......@@ -194,9 +194,10 @@ describe Sentry::Client do
context 'sentry api response too large' 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
......
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