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

Better output from JS_ToCString() on exception #274

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

bnoordhuis
Copy link
Contributor

@bnoordhuis bnoordhuis commented Feb 18, 2024

ToString(object) can fail when there is a pending exception. Add a special case for exception objects to help debugging. Getting an empty string when the real error was "InternalError: stack overflow" is rage inducing.

Fixes: #273


I couldn't really think of a good way to test this but I can say it works well in a project where I was getting rage induced.

`ToString(object)` can fail when there is a pending exception. Add a
special case for exception objects to help debugging. Getting an empty
string when the real error was "InternalError: stack overflow" is rage
inducing.

Fixes: quickjs-ng#273
Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Nice! Does this somewhat supersede #249 ?

@bnoordhuis
Copy link
Contributor Author

Oh, I guess it does. I'll go and close that one.

@bnoordhuis bnoordhuis merged commit b257545 into quickjs-ng:master Feb 19, 2024
35 checks passed
@bnoordhuis bnoordhuis deleted the fix273 branch February 19, 2024 15:31
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.

Make JS_ToCString return legible result for InternalErrors
2 participants