Skip to content

Commit a646e7f

Browse files
committed
Fix JSON format alert output
1 parent 484f91c commit a646e7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/clique_json_writer.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ prepare(Status) ->
6565
prepare_status(alert, Ctx=#context{alert_set=true}) ->
6666
%% TODO: Should we just return an error instead?
6767
throw({error, nested_alert, Ctx});
68-
prepare_status(Term, Ctx=#context{alert_set=true, alert_list=AList}) ->
69-
Ctx#context{alert_list=[Term | AList]};
7068
prepare_status(alert, Ctx) ->
7169
Ctx#context{alert_set=true};
7270
prepare_status(alert_done, Ctx = #context{alert_list=AList, output=Output}) ->
7371
%% AList is already reversed, and prepare returns reversed output, so they cancel out
7472
AlertJsonVal = prepare(AList),
7573
AlertJson = {struct, [{<<"type">>, <<"alert">>}, {<<"alert">>, AlertJsonVal}]},
7674
Ctx#context{alert_set=false, alert_list=[], output=[AlertJson | Output]};
75+
prepare_status(Term, Ctx=#context{alert_set=true, alert_list=AList}) ->
76+
Ctx#context{alert_list=[Term | AList]};
7777
prepare_status({list, Data}, Ctx=#context{output=Output}) ->
7878
Ctx#context{output=[prepare_list(Data) | Output]};
7979
prepare_status({list, Title, Data}, Ctx=#context{output=Output}) ->

0 commit comments

Comments
 (0)