Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
juga
sbws
Commits
b88fa16b
Commit
b88fa16b
authored
7 years ago
by
Matt Traudt
Committed by
Matt Traudt
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Let logging do the work of logging a backtrace
parent
d37b3536
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbws/core/client.py
+3
-17
3 additions, 17 deletions
sbws/core/client.py
with
3 additions
and
17 deletions
sbws/core/client.py
+
3
−
17
View file @
b88fa16b
...
...
@@ -21,8 +21,6 @@ import socks
import
socket
import
time
import
os
import
sys
import
traceback
import
logging
end_event
=
Event
()
...
...
@@ -244,19 +242,7 @@ def dispatch_worker_thread(*a, **kw):
try
:
return
measure_relay
(
*
a
,
**
kw
)
except
Exception
as
err
:
log
.
error
(
'
Unhandled exception: {} {}
'
.
format
(
type
(
err
),
err
))
_
,
_
,
tb
=
sys
.
exc_info
()
if
tb
is
not
None
:
tb_info
=
traceback
.
extract_tb
(
tb
)
dots
=
'
'
for
loc
in
tb_info
:
fname
,
line
,
func
,
text
=
loc
fname
=
os
.
path
.
basename
(
fname
)
log
.
error
(
dots
,
'
{}:{} {} --> {}
'
.
format
(
fname
,
line
,
func
,
text
))
dots
+=
'
>>
'
else
:
log
.
error
(
'
No traceback available :(
'
)
log
.
exception
(
'
Unhandled exception in worker thread
'
)
raise
err
...
...
@@ -309,8 +295,8 @@ def result_putter_error(target):
measurement -- and return that function so it can be used by someone else
'''
def
closure
(
err
):
log
.
warning
(
'
Unhandled exception caught while measuring %s: %s %s
'
,
target
.
nickname
,
type
(
err
),
err
)
log
.
error
(
'
Unhandled exception caught while measuring %s: %s %s
'
,
target
.
nickname
,
type
(
err
),
err
)
return
closure
...
...
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