correctly catch and convert badjson errors
This commit is contained in:
parent
ac518dfe4a
commit
2bc885f3c4
1 changed files with 1 additions and 1 deletions
|
@ -101,7 +101,7 @@ decoder({{Mod, Fun}, State}, OptsList) when is_list(OptsList), is_atom(Mod), is_
|
|||
Opts = parse_opts(OptsList),
|
||||
decoder({fun(E, S) -> Mod:Fun(E, S) end, State}, Opts);
|
||||
decoder(Callbacks, Opts) ->
|
||||
fun(Stream) -> try start(Stream, [], Callbacks, Opts) catch error:function_clause -> {error, badjson} end end.
|
||||
fun(Stream) -> try start(Stream, [], Callbacks, Opts) catch error:function_clause -> {error, badjson} ;error:badjson -> {error, badjson} end end.
|
||||
|
||||
|
||||
parse_opts(Opts) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue