Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-lister
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-lister
Commits
1d7d9b61
Commit
1d7d9b61
authored
6 years ago
by
David Douard
Browse files
Options
Downloads
Patches
Plain Diff
Log errors when fetching an url in SWHListerHttpTransport
parent
68eb727d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/lister/core/lister_transports.py
+5
-0
5 additions, 0 deletions
swh/lister/core/lister_transports.py
with
5 additions
and
0 deletions
swh/lister/core/lister_transports.py
+
5
−
0
View file @
1d7d9b61
...
...
@@ -7,6 +7,7 @@ import random
from
datetime
import
datetime
from
email.utils
import
parsedate
from
pprint
import
pformat
import
logging
import
requests
import
xmltodict
...
...
@@ -20,6 +21,9 @@ from .abstractattribute import AbstractAttribute
from
.lister_base
import
FetchError
logger
=
logging
.
getLogger
(
__name__
)
class
SWHListerHttpTransport
(
abc
.
ABC
):
"""
Use the Requests library for making Lister endpoint requests.
...
...
@@ -114,6 +118,7 @@ class SWHListerHttpTransport(abc.ABC):
else
:
response
=
self
.
session
.
get
(
path
,
**
params
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
logger
.
warning
(
'
Failed to fetch %s: %s
'
,
path
,
e
)
raise
FetchError
(
e
)
else
:
if
response
.
status_code
not
in
self
.
EXPECTED_STATUS_CODES
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment