Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Base Worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
Workers
Base Worker
Commits
91c53ba1
Commit
91c53ba1
authored
4 years ago
by
Eva Bardou
Committed by
Bastien Abadie
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve API exceptions display when fetching element
parent
3929d33a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Improve API exceptions display when fetching element
Pipeline
#77855
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arkindex_worker/worker.py
+10
-2
10 additions, 2 deletions
arkindex_worker/worker.py
with
10 additions
and
2 deletions
arkindex_worker/worker.py
+
10
−
2
View file @
91c53ba1
...
...
@@ -6,6 +6,8 @@ import os
import
sys
import
uuid
from
apistar.exceptions
import
ErrorResponse
from
arkindex
import
ArkindexClient
,
options_from_env
from
arkindex_worker
import
logger
from
arkindex_worker.models
import
Element
...
...
@@ -124,12 +126,18 @@ class ElementsWorker(BaseWorker):
**
self
.
api_client
.
request
(
"
RetrieveElement
"
,
id
=
element_id
)
)
logger
.
info
(
f
"
Processing
{
element
}
(
{
i
}
/
{
count
}
)
"
)
self
.
process_element
(
element
)
except
ErrorResponse
as
e
:
failed
+=
1
logger
.
warning
(
f
"
An API error occurred while processing element
{
element_id
}
:
{
e
.
title
}
-
{
e
.
content
}
"
,
exc_info
=
e
if
self
.
args
.
verbose
else
None
,
)
self
.
report
.
error
(
element_id
,
e
)
except
Exception
as
e
:
failed
+=
1
logger
.
warning
(
"
Failed running worker on
{}: {!r}
"
.
format
(
element_id
,
e
)
,
f
"
Failed running worker on
element
{
element_id
}
:
{
e
}
"
,
exc_info
=
e
if
self
.
args
.
verbose
else
None
,
)
self
.
report
.
error
(
element_id
,
e
)
...
...
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