Skip to content

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
@bnoordhuis bnoordhuis deleted the fix273 branch February 19, 2024 15:31
saghul pushed a commit that referenced this pull request Apr 4, 2025
saghul pushed a commit that referenced this pull request Apr 4, 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.

Make JS_ToCString return legible result for InternalErrors

2 participants