swap badarg' error for
function_clause' error in jsx:format/x
This commit is contained in:
parent
453d4078e0
commit
3df6a1dab6
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ to_json(Source, Config) when is_list(Config) ->
|
||||||
-spec format(Source::binary(), Config::config()) -> binary().
|
-spec format(Source::binary(), Config::config()) -> binary().
|
||||||
|
|
||||||
format(Source, Config) when is_binary(Source) andalso is_list(Config) ->
|
format(Source, Config) when is_binary(Source) andalso is_list(Config) ->
|
||||||
(jsx:decoder(?MODULE, Config, jsx_config:extract_config(Config ++ [escaped_strings])))(Source).
|
(jsx:decoder(?MODULE, Config, jsx_config:extract_config(Config ++ [escaped_strings])))(Source);
|
||||||
|
format(_, _) -> erlang:error(badarg).
|
||||||
|
|
||||||
|
|
||||||
parse_config(Config) -> parse_config(Config, #config{}).
|
parse_config(Config) -> parse_config(Config, #config{}).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue