Commit f092b3aa authored by Igor Drozdov's avatar Igor Drozdov

Log Sentry error when license-key is invalid

parent 5c2ac9ab
......@@ -632,7 +632,9 @@ class Repository
return if licensee_object.name.blank?
licensee_object
rescue Licensee::InvalidLicense
rescue Licensee::InvalidLicense => ex
Gitlab::ErrorTracking.track_exception(ex)
nil
end
memoize_method :license
......
......@@ -1340,6 +1340,9 @@ RSpec.describe Repository do
it 'returns nil when license_key is not recognized' do
expect(repository).to receive(:license_key).twice.and_return('not-recognized')
expect(Gitlab::ErrorTracking).to receive(:track_exception) do |ex|
expect(ex).to be_a(Licensee::InvalidLicense)
end
expect(repository.license).to be_nil
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