change error_handler function signature to /3 from /6

This commit is contained in:
alisdair sullivan 2013-03-04 20:40:39 -08:00
parent 8eb302b45f
commit 3162891832
2 changed files with 7 additions and 7 deletions

View file

@ -95,7 +95,7 @@ decoder(Handler, State, Config) ->
-define(error(State, Bin, Handler, Acc, Stack, Config),
case Config#config.error_handler of
false -> erlang:error(badarg);
F -> F(State, Bin, Handler, Acc, Stack, Config)
F -> F(Bin, {decoder, State, Handler, Acc, Stack}, Config)
end
).
-define(error(State, Bin, Handler, Stack, Config),
@ -1948,7 +1948,7 @@ error_test_() ->
custom_error_handler_test_() ->
Decode = fun(JSON, Config) -> start(JSON, {jsx, []}, [], jsx_utils:parse_config(Config)) end,
Error = fun(State, Rest, _Handler, _Acc, _Stack, _Config) -> {State, Rest} end,
Error = fun(Rest, {_, State, _, _, _}, _) -> {State, Rest} end,
[
{"maybe_bom error", ?_assertEqual(
{value, <<16#ef, 0>>},