Skip to content
Browse files

fix json decode errors with jiffy

  • Loading branch information...
1 parent f0fab10 commit 4c3831203358c308b954db1f714f6c7e7a92f996 @puzza007 puzza007 committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/sockjs_util.erl
View
6 src/sockjs_util.erl
@@ -36,4 +36,8 @@ eep0018(JSON, decode) -> json:decode(JSON).
jiffy(Thing, encode) ->
iolist_to_binary(jiffy:encode(Thing));
jiffy(JSON, decode) ->
- {ok, jiffy:decode(JSON)}.
+ try jiffy:decode(JSON) of
+ V -> {ok, V}
+ catch
+ E -> E
+ end.

0 comments on commit 4c38312

Please sign in to comment.
Something went wrong with that request. Please try again.