Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Add Stack Trace from Call-site not Error site #402

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hayesgm
Copy link
Contributor

@hayesgm hayesgm commented Jul 14, 2021

Due to the async callback nature of sendAndWaitForEvents, errors are raised in the callback code, which leads to an error's stacktrace being just that, in some generic callback code. This patch captures a backtrace at the original callsite and then attaches that to an error before it's returned. As such, it's possible to give the user a more helpful error. It's a bit of a hack, but not utilizing any undefined behavior.

Due to the async callback nature of sendAndWaitForEvents, errors are raised in the callback code, which leads to an error's stacktrace being just that, in some generic callback code. This patch captures a backtrace at the original callsite and then attaches that to an error before it's returned. As such, it's possible to give the user a more helpful error. It's a bit of a hack, but not utilizing any undefined behavior.
@hayesgm hayesgm requested review from jflatow and mykelp July 14, 2021 01:49
@github-actions
Copy link

🫖 View Test Results

@github-actions

This comment has been minimized.

@github-actions
Copy link

🫖 [View Integration Test Results](server error: invalid xunit xml)

@github-actions
Copy link

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3c0b27e. ± Comparison against base commit 1149fde.

Copy link
Contributor

@jflatow jflatow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 🔥 Better than nothing assuming its accurate, and don't see why it wouldn't be

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants