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
This is a counterpart of issue #519, which requested to show GAP error backtrace in Julia.
It would be good to show also Julia error backrtace in GAP.
For example, pure Julia shows the following.
julia> sqrt(-1)
ERROR: DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
Stacktrace:
[1] throw_complex_domainerror(::Symbol, ::Float64) at ./math.jl:33
[2] sqrt at ./math.jl:557 [inlined]
[3] sqrt(::Int64) at ./math.jl:583
[4] top-level scope at REPL[24]:1
Julia called from a GAP session shows the following (without the Julia stacktrace information).
gap> JuliaEvalString( "sqrt(-1)" )
> ;
Error, DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
not in any function at *stdin*:2
type 'quit;' to quit to outer loop
brk>
Double indirection (call Julia from GAP from Julia) in a Julia session shows the following (without the inner Julia stacktrace information).
julia> GAP.evalstr( "JuliaEvalString( \"sqrt(-1)\" )")
ERROR: Error thrown by GAP: Error, DomainError with -1.0:
sqrt will only return a complex result if called with a complex argument. Try sqrt(Complex(x)).
not in any function at stream:1
Stacktrace:
[1] error(::String, ::String) at ./error.jl:42
[2] error_handler() at /export/home/sam/gap/4.0/pkg/GAP.jl/src/GAP.jl:158
[3] evalstr_ex at /export/home/sam/gap/4.0/pkg/GAP.jl/src/ccalls.jl:36 [inlined]
[4] evalstr(::String) at /export/home/sam/gap/4.0/pkg/GAP.jl/src/ccalls.jl:63
[5] top-level scope at REPL[2]:1
In order to show also the stacktrace information, we have to change the function handle_jl_exception in JuliaInterface.c. As far as I understand, also the entries of Base.catch_stack() have to be entered in the calls of showerror, but the documentation of Base.catch_stack (in Julia 1.4) contains a warning that this function is experimental in Julia 1.1. Can we rely on this function?
The text was updated successfully, but these errors were encountered:
The documentation for Base.catch_stack references JuliaLang/julia#29901 where it is renamed to current_exceptions, but they actually leave the old name in with a deprecation warning. So I think we should be safe to use it for now; dealing with a renaming is also easy enough.
This is a counterpart of issue #519, which requested to show GAP error backtrace in Julia.
It would be good to show also Julia error backrtace in GAP.
For example, pure Julia shows the following.
Julia called from a GAP session shows the following (without the Julia stacktrace information).
Double indirection (call Julia from GAP from Julia) in a Julia session shows the following (without the inner Julia stacktrace information).
In order to show also the stacktrace information, we have to change the function
handle_jl_exception
inJuliaInterface.c
. As far as I understand, also the entries ofBase.catch_stack()
have to be entered in the calls ofshowerror
, but the documentation ofBase.catch_stack
(in Julia 1.4) contains a warning that this function is experimental in Julia 1.1. Can we rely on this function?The text was updated successfully, but these errors were encountered: