Skip to content

Commit

Permalink
record_exception: Accept BaseException (#3354)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalmarhubi committed Mar 27, 2024
1 parent 29c293f commit c2fc945
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3648](https://github.com/open-telemetry/opentelemetry-python/pull/3648))
- Fix ValueError message for PeriodicExportingMetricsReader
([#3769](https://github.com/open-telemetry/opentelemetry-python/pull/3769))
- Use `BaseException` instead of `Exception` in `record_exception`
([#3354](https://github.com/open-telemetry/opentelemetry-python/pull/3354))
- Make span.record_exception more robust
([#3778](https://github.com/open-telemetry/opentelemetry-python/pull/3778))
- Fix license field in pyproject.toml files
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-api/src/opentelemetry/trace/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def set_status(
@abc.abstractmethod
def record_exception(
self,
exception: Exception,
exception: BaseException,
attributes: types.Attributes = None,
timestamp: typing.Optional[int] = None,
escaped: bool = False,
Expand Down Expand Up @@ -563,7 +563,7 @@ def set_status(

def record_exception(
self,
exception: Exception,
exception: BaseException,
attributes: types.Attributes = None,
timestamp: typing.Optional[int] = None,
escaped: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ def __exit__(

def record_exception(
self,
exception: Exception,
exception: BaseException,
attributes: types.Attributes = None,
timestamp: Optional[int] = None,
escaped: bool = False,
Expand Down

0 comments on commit c2fc945

Please sign in to comment.