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
a4e6123e
Commit
a4e6123e
authored
Mar 23, 2020
by
Marius Bobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::HTTP.try_get to handle errors
parent
58059f97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
app/models/project_services/teamcity_service.rb
app/models/project_services/teamcity_service.rb
+6
-7
No files found.
app/models/project_services/teamcity_service.rb
View file @
a4e6123e
...
...
@@ -86,12 +86,11 @@ class TeamcityService < CiService
def
calculate_reactive_cache
(
sha
,
ref
)
response
=
get_path
(
"httpAuth/app/rest/builds/branch:unspecified:any,revision:
#{
sha
}
"
)
{
build_page:
read_build_page
(
response
),
commit_status:
read_commit_status
(
response
)
}
rescue
Errno
::
ECONNREFUSED
=>
e
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
project_id:
project_id
)
{
build_page:
teamcity_url
,
commit_status: :error
}
if
response
{
build_page:
read_build_page
(
response
),
commit_status:
read_commit_status
(
response
)
}
else
{
build_page:
teamcity_url
,
commit_status: :error
}
end
end
def
execute
(
data
)
...
...
@@ -154,7 +153,7 @@ class TeamcityService < CiService
end
def
get_path
(
path
)
Gitlab
::
HTTP
.
get
(
build_url
(
path
),
verify:
false
,
basic_auth:
basic_auth
)
Gitlab
::
HTTP
.
try_get
(
build_url
(
path
),
verify:
false
,
basic_auth:
basic_auth
,
extra_log_info:
{
project_id:
project_id
}
)
end
def
post_to_build_queue
(
data
,
branch
)
...
...
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