-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
Is there any plan to add better errors than just badarg? It's problematic when trying to encode/decode inside more complex code:
try
complex_code(Binary) % Code that calls jsone:decode somewhere
catch
error:badarg:ST ->
case ST of
[{jsone_decode,_,_,_}|_] ->
?LOG_WARNING("Bad JSON: ~p", [Binary]);
_ ->
erlang:raise(error, badarg, ST)
end
end.It's impossible to know where the badarg error comes from without checking the stack trace.
I apologize if this have been considered already, since there might be a lot of code changes / possible overhead (e.g. if try-catch is used).
Metadata
Metadata
Assignees
Labels
No labels