I would like to be able to catch a panic for example in order to inspect its stack trace.
Ideally, the visualization should allow to show a stack trace for a panic by default, but that's probably another thing.
Expected behaviour
The same operations in the REPL work and allow to catch a Panic:
Uncaught panic
> r = Panic.throw "foo"
null:: warning: Unused variable r.
Evaluation failed with: foo
java.lang.Exception: foo
at <enso>.Panic.throw(Unknown Source)
at <enso>.<eval>(Unknown Source)
at <enso>.Debug.breakpoint(Unknown Source)
at <enso>.Rrepl::Rrepl::main(Rrepl.enso:46)
at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)
> r
null:: error: The name `r` could not be found.
Evaluation failed with: Compilation aborted due to errors.
java.lang.Exception: Compilation aborted due to errors.
at <enso>.Debug.breakpoint(Unknown Source)
at <enso>.Rrepl::Rrepl::main(Rrepl.enso:46)
at <unknown>.org.graalvm.polyglot.Value<Function>.execute(Unknown Source)
Panic recovered as dataflow error
> r = Panic.recover Any (Panic.throw "foo")
null:: warning: Unused variable r.
>>> Nothing
> r
>>> (Error: 'foo')
> r.catch
>>> foo
Caught panic
> r = Panic.catch Any (Panic.throw "foo") c->c.payload
null:: warning: Unused variable r.
>>> Nothing
> r
>>> foo
I would like to be able to catch a panic for example in order to inspect its stack trace.
Ideally, the visualization should allow to show a stack trace for a panic by default, but that's probably another thing.
Expected behaviour
The same operations in the REPL work and allow to catch a Panic:
Uncaught panic
Panic recovered as dataflow error
Caught panic