You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment (0.9.11) the stacktrace when an Eval panics goes only to the apps fmt.Println() and not to the configured interp.Options.Stderr. This makes it hard to capture the stack trace when you wish to surface that info to somewhere other than the apps stdout.
If yaegi also printed the stacktrace to the configured interp.Options.Stderr it would make it possible for me to consume it, and logically it makes sense to me that the stacktrace would appear in the scripts configured Stderr.
I recover() from Eval panics and wish to show the existing stacktrace (that only seems to go to the apps stdout) to the user in the GUI.
Workarounds
I could not find one, but maybe I missed another way of getting the stacktrace from a panic'ed eval?
I am also compiling for JS/WASM where os.Pipe() is not available, so I cannot simply replace and consume main apps Stdout/err to get the stacktrace when the Eval panics.
The text was updated successfully, but these errors were encountered:
TheMightyGit
changed the title
Send stacktrace from paniced Eval to the configured interp.Options.Stderr
Send existing stacktrace from paniced Eval to the configured interp.Options.Stderr
Feb 3, 2021
As mentioned in #1030, when an Eval panic, it is print with `fmt.Println()` and not to the configured `interp.Options.Stderr`. According to https://github.com/traefik/yaegi/blob/master/interp/interp.go#L210, it should be removed in future version so I'm not sure if this pull request is necessary. However, it could fix the issue in the meanwhile.
Fixes#1030.
Proposal
At the moment (0.9.11) the stacktrace when an Eval panics goes only to the apps
fmt.Println()
and not to the configuredinterp.Options.Stderr
. This makes it hard to capture the stack trace when you wish to surface that info to somewhere other than the apps stdout.If yaegi also printed the stacktrace to the configured
interp.Options.Stderr
it would make it possible for me to consume it, and logically it makes sense to me that the stacktrace would appear in the scripts configured Stderr.I believe this is the line that prints it - https://github.com/traefik/yaegi/blob/master/interp/run.go#L182
Background
I
recover()
from Eval panics and wish to show the existing stacktrace (that only seems to go to the apps stdout) to the user in the GUI.Workarounds
I could not find one, but maybe I missed another way of getting the stacktrace from a panic'ed eval?
I am also compiling for JS/WASM where os.Pipe() is not available, so I cannot simply replace and consume main apps Stdout/err to get the stacktrace when the Eval panics.
The text was updated successfully, but these errors were encountered: