Skip to content

Commit

Permalink
render_ev: return stack on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Ki committed Jun 3, 2019
1 parent 6964505 commit 36c7fd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protos/n2o_nitro.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down

0 comments on commit 36c7fd1

Please sign in to comment.