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

Rework exceptions and stacktraces #1963

Draft
wants to merge 1 commit into
base: 6.0.0
Choose a base branch
from

Conversation

kuhnroyal
Copy link
Member

An evaluation of how DioException can work with better stack traces that can be catched while still being aware of the cause and the stack trace of the cause.
Related to #1914

  • rename DioException.error to DioException.cause
  • add DioException.causeStackTrace
  • get rid of RequestOptions.sourceStackTrace property
  • use Error.throwWithStackTrace to throw all errors with the manually captured stack trace at a single point in DioMixin
  • extract some inner functions inside DioMixin.fetch to prevent them capturing the state of requestOptions and cancelToken variables, instead pass them as arguments

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

* rename `DioException.error` to `DioException.cause`
* add `DioException.causeStackTrace`
* get rid of `RequestOptions.sourceStackTrace` property
* use `Error.throwWithStackTrace` to throw all errors with the manually captured stack trace at a single point in `DioMixin`
* extract some inner functions inside `DioMixin.fetch` to prevent them capturing the state of `requestOptions` and `cancelToken` variables, instead pass them as arguments
@kuhnroyal kuhnroyal added s: feature This issue indicates a feature request p: dio Targeting `dio` package labels Sep 11, 2023
@kuhnroyal kuhnroyal self-assigned this Sep 11, 2023
@kuhnroyal kuhnroyal added this to the 6.0.0 milestone Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: dio Targeting `dio` package s: feature This issue indicates a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant