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

shell: Improve ShellError stacktrace #9233

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

zackradisic
Copy link
Member

@zackradisic zackradisic commented Mar 4, 2024

What does this PR do?

This fixes errors thrown by Bun shell not showing the original stacktrace (Fixes #9182)

This is done by creating an Error object upfront upon creation of the ShellPromise.

Creating an Error object shouldn't be too costly

I put breakpoints on the computeErrorInfo... functions in ZigGlobalObject.cpp to make sure we're not doing the expensive thing of computing the stack trace, didn't seem to hit any of those functions so think we should be good

  • Code changes

How did you verify your code works?

  • I included a test for the new code, or existing tests cover it
  • I ran my tests locally and they pass (bun-debug test test-file-name.test)

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Contributor

github-actions bot commented Mar 4, 2024

Copy link
Contributor

github-actions bot commented Mar 4, 2024

Copy link
Contributor

github-actions bot commented Mar 4, 2024

@zackradisic 1 files with test failures on bun-darwin-aarch64:

View test output

#b26e8a284b05dbc00e714f6919dd59c183e9acd1

Copy link
Contributor

github-actions bot commented Mar 4, 2024

@zackradisic 1 files with test failures on bun-darwin-x64:

View test output

#b26e8a284b05dbc00e714f6919dd59c183e9acd1

@Jarred-Sumner Jarred-Sumner merged commit 05a7779 into main Mar 4, 2024
26 of 31 checks passed
@Jarred-Sumner Jarred-Sumner deleted the shell-better-error-stacktrace branch March 4, 2024 05:46
@Jarred-Sumner
Copy link
Collaborator

Thank you

Copy link
Contributor

github-actions bot commented Mar 4, 2024

❌🪟 @zackradisic, there are 11 test regressions on Windows x86_64

  • test\cli\run\transpiler-cache.test.ts
  • test\js\bun\dns\resolve-dns.test.ts
  • test\js\bun\http\fetch-file-upload.test.ts
  • test\js\bun\http\bun-server.test.ts
  • test\js\bun\shell\shelloutput.test.ts
  • test\js\bun\shell\throw.test.ts
  • test\js\node\dns\node-dns.test.js
  • test\js\node\process\process-args.test.js
  • test\js\web\fetch\body-stream-excess.test.ts
  • test\js\web\fetch\body-stream.test.ts
  • test\js\web\workers\worker.test.ts

Full Test Output

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.

ShellError should show original stack trace
2 participants