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

Improve stack overflow, show more properties in Error objects #15985

Merged
merged 35 commits into from
Dec 26, 2024

Conversation

Jarred-Sumner
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner commented Dec 24, 2024

What does this PR do?

I got sidetracked while trying to make the postgres client throw better errors

Fixes #817
Fixes #185

In order to be able to display all the own properties of Error objects when you console.log them, we need to handle stack overflow

In order to handle stack overflow, we need a way to track stack overflow

Now that we have a way to know in Zig if there's a stack overflow, I added it to the JS parser so we can handle stack overflow while visiting

Also, we should not be using std.bit_set. It copies the entire 90 KB bitset onto the stack. Our bun.bit_set fixes that.

How did you verify your code works?

There are some tests.

@robobun
Copy link

robobun commented Dec 24, 2024

Updated 11:07 PM PT - Dec 25th, 2024

@paperdave, your commit 1cf8c16 has passed in #8527! 🎉


🧪   try this PR locally:

bunx bun-pr 15985

@kravetsone
Copy link

Great! I want to report it soon but u already open this))

This happened with my TelegramError extended from Error class

I add additional keys such as params as a better way to determine which parameters are used in this failed request

But it shows only in Node for now(

@Jarred-Sumner Jarred-Sumner merged commit 2b2ca32 into main Dec 26, 2024
66 of 67 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/stack-overflow branch December 26, 2024 05:47
probably-neb pushed a commit to probably-neb/bun that referenced this pull request Jan 7, 2025
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.

Too many nested for-loops causes segfault Printing Error does not show all properties
4 participants