Skip to content

Better output from JS_ToCString() on exception#274

Merged
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:fix273
Feb 19, 2024
Merged

Better output from JS_ToCString() on exception#274
bnoordhuis merged 1 commit intoquickjs-ng:masterfrom
bnoordhuis:fix273

Conversation

@bnoordhuis
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
cuiweixie pushed a commit to cuiweixie/quickjs that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants