Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f092b3aa
Commit
f092b3aa
authored
Sep 09, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log Sentry error when license-key is invalid
parent
5c2ac9ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
app/models/repository.rb
app/models/repository.rb
+3
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+3
-0
No files found.
app/models/repository.rb
View file @
f092b3aa
...
...
@@ -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
...
...
spec/models/repository_spec.rb
View file @
f092b3aa
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment