Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
satella
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
satella
Commits
ce27e267
Commit
ce27e267
authored
4 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
trace_exception can take None as an argument
parent
7af085b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
satella/__init__.py
+1
-1
1 addition, 1 deletion
satella/__init__.py
satella/opentracing/exceptions.py
+5
-2
5 additions, 2 deletions
satella/opentracing/exceptions.py
tests/test_opentracing.py
+8
-0
8 additions, 0 deletions
tests/test_opentracing.py
with
16 additions
and
3 deletions
CHANGELOG.md
+
2
−
0
View file @
ce27e267
# v2.16.6
*
trace_exception can take None as an argument
This diff is collapsed.
Click to expand it.
satella/__init__.py
+
1
−
1
View file @
ce27e267
__version__
=
'
2.16.6a
1
'
__version__
=
'
2.16.6a
2
'
This diff is collapsed.
Click to expand it.
satella/opentracing/exceptions.py
+
5
−
2
View file @
ce27e267
...
...
@@ -7,17 +7,20 @@ from satella.instrumentation import Traceback
from
satella.opentracing.trace
import
Span
def
trace_exception
(
span
:
Span
,
exc_type
:
tp
.
Optional
[
ExceptionClassType
]
=
None
,
def
trace_exception
(
span
:
tp
.
Optional
[
Span
]
,
exc_type
:
tp
.
Optional
[
ExceptionClassType
]
=
None
,
exc_val
:
tp
.
Optional
[
Exception
]
=
None
,
exc_tb
:
tp
.
Optional
[
types
.
TracebackType
]
=
None
)
->
None
:
"""
Log an exception
'
s information to the chosen span, as logs and tags.
:param span: span to log into
:param span: span to log into
or None for a no-op
:param exc_type: exception type. If None this will be taken from sys.exc_info.
:param exc_val: exception value. If None this will be taken from sys.exc_info.
:param exc_tb: exception traceback. If None this will be taken from sys.exc_info.
"""
if
span
is
None
:
return
if
exc_type
is
None
:
exc_type
,
exc_val
,
exc_tb
=
sys
.
exc_info
()
if
exc_type
is
None
:
...
...
This diff is collapsed.
Click to expand it.
tests/test_opentracing.py
0 → 100644
+
8
−
0
View file @
ce27e267
import
unittest
from
satella.opentracing
import
trace_exception
class
TestOpentracing
(
unittest
.
TestCase
):
def
test_trace_exception_none
(
self
):
trace_exception
(
None
)
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