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
b1c95db1
Commit
b1c95db1
authored
Mar 12, 2021
by
Markus Koller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't track JiraImport::UsersImporter errors in Sentry
parent
cffdff1f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
app/services/jira_import/users_importer.rb
app/services/jira_import/users_importer.rb
+1
-1
spec/services/jira_import/users_importer_spec.rb
spec/services/jira_import/users_importer_spec.rb
+4
-1
No files found.
app/services/jira_import/users_importer.rb
View file @
b1c95db1
...
@@ -13,7 +13,7 @@ module JiraImport
...
@@ -13,7 +13,7 @@ module JiraImport
ServiceResponse
.
success
(
payload:
mapped_users
)
ServiceResponse
.
success
(
payload:
mapped_users
)
rescue
Timeout
::
Error
,
Errno
::
EINVAL
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
,
URI
::
InvalidURIError
,
JIRA
::
HTTPError
,
OpenSSL
::
SSL
::
SSLError
=>
error
rescue
Timeout
::
Error
,
Errno
::
EINVAL
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
,
URI
::
InvalidURIError
,
JIRA
::
HTTPError
,
OpenSSL
::
SSL
::
SSLError
=>
error
Gitlab
::
ErrorTracking
.
track
_exception
(
error
,
project_id:
project
.
id
)
Gitlab
::
ErrorTracking
.
log
_exception
(
error
,
project_id:
project
.
id
)
ServiceResponse
.
error
(
message:
"There was an error when communicating to Jira"
)
ServiceResponse
.
error
(
message:
"There was an error when communicating to Jira"
)
rescue
Projects
::
ImportService
::
Error
=>
error
rescue
Projects
::
ImportService
::
Error
=>
error
ServiceResponse
.
error
(
message:
error
.
message
)
ServiceResponse
.
error
(
message:
error
.
message
)
...
...
spec/services/jira_import/users_importer_spec.rb
View file @
b1c95db1
...
@@ -54,8 +54,11 @@ RSpec.describe JiraImport::UsersImporter do
...
@@ -54,8 +54,11 @@ RSpec.describe JiraImport::UsersImporter do
end
end
context
'when jira client raises an error'
do
context
'when jira client raises an error'
do
let
(
:error
)
{
Timeout
::
Error
.
new
}
it
'returns an error response'
do
it
'returns an error response'
do
expect
(
client
).
to
receive
(
:get
).
and_raise
(
Timeout
::
Error
)
expect
(
client
).
to
receive
(
:get
).
and_raise
(
error
)
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:log_exception
).
with
(
error
,
project_id:
project
.
id
)
expect
(
subject
.
error?
).
to
be_truthy
expect
(
subject
.
error?
).
to
be_truthy
expect
(
subject
.
message
).
to
include
(
'There was an error when communicating to Jira'
)
expect
(
subject
.
message
).
to
include
(
'There was an error when communicating to Jira'
)
...
...
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