From 664ec9cca6ac08ec636f24da46f66623e35102b6 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Fri, 5 Jul 2024 16:04:30 +1200 Subject: [PATCH] add .backtrace property --- src/sandbox.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sandbox.jl b/src/sandbox.jl index 750745a..e895363 100644 --- a/src/sandbox.jl +++ b/src/sandbox.jl @@ -115,6 +115,13 @@ function Base.getproperty(r::Result, name::Symbol) return getfield(r, :_value) isa ExceptionValue elseif name === :value return getfield(r, :_value)[] + elseif name === :backtrace + value = getfield(r, :_value) + if value isa ExceptionValue + return value.backtrace + else + return nothing + end else return getfield(r, name) end