From 36c7fd11c25f33286d5bee1bf4fed1c331adb729 Mon Sep 17 00:00:00 2001 From: Vlad Ki Date: Mon, 3 Jun 2019 17:26:23 +0300 Subject: [PATCH] render_ev: return stack on failure --- src/protos/n2o_nitro.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protos/n2o_nitro.erl b/src/protos/n2o_nitro.erl index a7430e0b..8b384150 100644 --- a/src/protos/n2o_nitro.erl +++ b/src/protos/n2o_nitro.erl @@ -69,7 +69,7 @@ render_ev(#ev{name=F,msg=P,trigger=T},_Source,Linked,State=#cx{module=M}) -> api_event -> M:F(P,Linked,State); event -> [erlang:put(K, nitro:to_binary([V])) || {K,V} <- Linked], M:F(P); _ -> M:F(P,T,State) end - catch E:R:S -> ?LOG_EXCEPTION(E,R,S), {io,[],{stack,S}} end. + catch E:R:S -> ?LOG_EXCEPTION(E,R,S), {stack,S} end. io(Event, #cx{module=Module}) -> try X = Module:event(Event), {io,render_actions(nitro:actions()),X} @@ -86,7 +86,7 @@ render_ev(#ev{name=F,msg=P,trigger=T},_Source,Linked,State=#cx{module=M}) -> api_event -> M:F(P,Linked,State); event -> [erlang:put(K, nitro:to_binary([V])) || {K,V} <- Linked], M:F(P); _ -> M:F(P,T,State) end - catch E:R -> S = erlang:get_stacktrace(), ?LOG_EXCEPTION(E,R,S), {io,<<>>,{stack,S}} end. + catch E:R -> S = erlang:get_stacktrace(), ?LOG_EXCEPTION(E,R,S), {stack,S} end. io(Event, #cx{module=Module}) -> try X = Module:event(Event), {io,render_actions(nitro:actions()),X}