|
@@ -16,8 +16,9 @@ info({init, Rest}, Req, State) ->
|
|
nitro:render(Elements),
|
|
nitro:render(Elements),
|
|
{ok, []}
|
|
{ok, []}
|
|
catch E1:R1:Stk1 ->
|
|
catch E1:R1:Stk1 ->
|
|
- wf:error(?MODULE, "main: E:R:Stk: ~p ~p~n ~p~n", [E1, R1, Stk1]),
|
|
|
|
- {error, [E1, R1, Stk1]}
|
|
|
|
|
|
+ Err1 = [E1, R1, Stk1],
|
|
|
|
+ wf:error(?MODULE, "main: E:R:Stk: ~p ~p~n ~p~n", Err1),
|
|
|
|
+ {error, Err1}
|
|
end;
|
|
end;
|
|
|
|
|
|
Binary ->
|
|
Binary ->
|
|
@@ -34,8 +35,9 @@ info({init, Rest}, Req, State) ->
|
|
_ -> n4u_session:ensure_sid([], ?CTX, [])
|
|
_ -> n4u_session:ensure_sid([], ?CTX, [])
|
|
end
|
|
end
|
|
catch E2:R2:Stk2 ->
|
|
catch E2:R2:Stk2 ->
|
|
- wf:error(?MODULE, "init: E:R:Stk: ~p ~p~n ~p~n", [E2, R2, Stk2]),
|
|
|
|
- {stack, [E2, R2, Stk2]}
|
|
|
|
|
|
+ Err2 = [E2, R2, Stk2],
|
|
|
|
+ wf:error(?MODULE, "init: E:R:Stk: ~p ~p~n ~p~n", Err2),
|
|
|
|
+ {stack, Err2}
|
|
end,
|
|
end,
|
|
Actions = render_actions(erlang:get(actions)),
|
|
Actions = render_actions(erlang:get(actions)),
|
|
{reply, wf:format({io, erlang:iolist_to_binary([InitActions, Actions]), <<>>}),
|
|
{reply, wf:format({io, erlang:iolist_to_binary([InitActions, Actions]), <<>>}),
|
|
@@ -51,8 +53,9 @@ info({pickle, _, _, _} = Event, Req, State) ->
|
|
erlang:put(actions, []),
|
|
erlang:put(actions, []),
|
|
Result = try html_events(Event, State)
|
|
Result = try html_events(Event, State)
|
|
catch E:R:Stk ->
|
|
catch E:R:Stk ->
|
|
- wf:error(?MODULE, "info pickle E:R:Stk: ~p ~p~n ~p~n", [E, R, Stk]),
|
|
|
|
- {io, render_actions(erlang:get(actions)), [E, R, Stk]}
|
|
|
|
|
|
+ Err = [E, R, Stk],
|
|
|
|
+ wf:error(?MODULE, "info pickle E:R:Stk: ~p ~p~n ~p~n", Err),
|
|
|
|
+ {io, render_actions(erlang:get(actions)), Err}
|
|
end,
|
|
end,
|
|
{reply, wf:format(Result), Req,
|
|
{reply, wf:format(Result), Req,
|
|
n4u_cx:context(State, ?MODULE, {pickle, Result})};
|
|
n4u_cx:context(State, ?MODULE, {pickle, Result})};
|
|
@@ -71,8 +74,9 @@ info({direct, Message}, Req, State) ->
|
|
Result = try Res = Module:event(Message),
|
|
Result = try Res = Module:event(Message),
|
|
{direct, Res}
|
|
{direct, Res}
|
|
catch E:R:Stk ->
|
|
catch E:R:Stk ->
|
|
- wf:error(?MODULE, "info direct E:R:Stk: ~p ~p~n ~p~n", [E, R, Stk]),
|
|
|
|
- {stack, [E, R, Stk]}
|
|
|
|
|
|
+ Err = [E, R, Stk],
|
|
|
|
+ wf:error(?MODULE, "info direct E:R:Stk: ~p ~p~n ~p~n", Err),
|
|
|
|
+ {stack, Err}
|
|
end,
|
|
end,
|
|
{reply, wf:format({io, render_actions(erlang:get(actions)), <<>>}),
|
|
{reply, wf:format({io, render_actions(erlang:get(actions)), <<>>}),
|
|
Req, n4u_cx:context(State, ?MODULE, Result)};
|
|
Req, n4u_cx:context(State, ?MODULE, Result)};
|