From 260d8c335ca5cae3bc22b4a93cc4cedcaf3067d3 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Thu, 21 Nov 2024 14:56:59 -0500 Subject: [PATCH] print the function name when `function has stopped!` error is reached --- src/macro.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/macro.jl b/src/macro.jl index d7663d9..c44da7a 100755 --- a/src/macro.jl +++ b/src/macro.jl @@ -212,7 +212,8 @@ macro resumable(ex::Expr...) func_def[:body] = quote _fsmi._state === 0x00 && @goto $(Symbol("_STATE_0")) $((:(_fsmi._state === $i && @goto $(Symbol("_STATE_",:($i)))) for i in 0x01:ui8.n)...) - error("@resumable function has stopped!") + _name = $_name + error(lazy"@resumable function $(_name) has stopped!") @label $(Symbol("_STATE_0")) _fsmi._state = 0xff _arg isa Exception && throw(_arg)