Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.

Fix #63: display traceback for exceptions in callables#64

Closed
qwenger wants to merge 1 commit intoPetterS:masterfrom
qwenger:feature_verbose_exceptions_in_callables
Closed

Fix #63: display traceback for exceptions in callables#64
qwenger wants to merge 1 commit intoPetterS:masterfrom
qwenger:feature_verbose_exceptions_in_callables

Conversation

@qwenger
Copy link
Collaborator

@qwenger qwenger commented Oct 22, 2021

Simple attempt for #63 . PyErr_WriteUnraisable seems to fit the bill quite well with minimal work.

Test:

>>> import quickjs
>>> def test():
...     1/0
... 
>>> ctx = quickjs.Context()
>>> ctx.add_callable("test", test)
>>> ctx.eval("test()")
Exception ignored in: <function test at 0x7efe29521940>
Traceback (most recent call last):
  File "<stdin>", line 2, in test
ZeroDivisionError: division by zero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_quickjs.JSException: InternalError: Python call failed.
    at test (native)
    at <eval> (<input>)

@qwenger
Copy link
Collaborator Author

qwenger commented Oct 27, 2021

Closing in favor of #67.

@qwenger qwenger closed this Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant