Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record_exception: Accept BaseException #3354

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

kamalmarhubi
Copy link
Contributor

@kamalmarhubi kamalmarhubi commented Jun 21, 2023

This makes it possible to call on the exception returned by sys.exc_info, which is a BaseException.

For ecosystem prior art, the equivalent in Java accepts a Throwable rather than Exception.

Fixes #2652

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

Answer the following question based on these examples of changes that would require a Contrib Repo Change:

  • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

  • The method interfaces of test/util have changed

  • Scripts in scripts/ that were copied over to the Contrib repo have changed

  • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

    • pyproject.toml
    • isort.cfg
    • .flake8
  • When a new .github/CODEOWNER is added

  • Major changes to project information, such as in:

    • README.md
    • CONTRIBUTING.md
  • Yes. - Link to PR:

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@kamalmarhubi kamalmarhubi requested a review from a team June 21, 2023 02:11
@kamalmarhubi kamalmarhubi force-pushed the record-base-exception branch 2 times, most recently from a591c56 to 4144797 Compare June 21, 2023 02:15
@lzchen
Copy link
Contributor

lzchen commented Sep 20, 2023

@kamalmarhubi

Could you rebase and include a test?

@ocelotl
Copy link
Contributor

ocelotl commented Mar 20, 2024

@lzchen this is only making a change in typing. BaseException is the parent class of Exception so this is not breaking, I am ok with merging it as it is.

This makes it possible to call on the exception returned by
[sys.exc_info], which is a BaseException.

For ecosystem prior art, the [equivalent in Java] accepts a Throwable
rather than Exception.

[sys.exc_info]: https://docs.python.org/3/library/sys.html#sys.exc_info
[equivalent in Java]: https://github.com/open-telemetry/opentelemetry-java/blob/7b8608591e1737ea0727d2373ddd813bc18cdaaa/api/all/src/main/java/io/opentelemetry/api/trace/Span.java#L344-L351
@kamalmarhubi
Copy link
Contributor Author

Oops missed this! Will rebase soon

@lzchen lzchen merged commit c2fc945 into open-telemetry:main Mar 27, 2024
232 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BaseException in record_exception
3 participants