-
Notifications
You must be signed in to change notification settings - Fork 134
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
Make JS_ToCString return legible result for InternalErrors #273
Labels
enhancement
New feature or request
Comments
bnoordhuis
added a commit
to bnoordhuis/quickjs
that referenced
this issue
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: quickjs-ng#273
bnoordhuis
added a commit
to bnoordhuis/quickjs
that referenced
this issue
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: quickjs-ng#273
bnoordhuis
added a commit
that referenced
this issue
Feb 19, 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
ramiropolla
pushed a commit
to ramiropolla/ffglitch-core
that referenced
this issue
Dec 10, 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: quickjs-ng/quickjs#273
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes, calling
JS_ToCString(ctx, val)
whereval
is an instance ofInternalError
returns an empty string. Not very helpful when the exception object does in fact have a.message
property with a human-readable error message.Probably happens when there is a pending exception. Deep down, quickjs tries to invoke the
[Symbol.toPrimitive]
method but I doubt that works while an exception is pending.Let's make debugging a little less miserable and special-case exception objects.
The text was updated successfully, but these errors were encountered: