summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent de Phily <vincent.dephily@gmail.com>2010-07-09 20:37:06 +0200
committerVincent de Phily <vincent.dephily@gmail.com>2010-07-09 20:37:06 +0200
commite944c1ee93083a054f318e42a16eff699d9f066d (patch)
tree881e3c3a2ce7c070bdaae44b960aa7118ac5506f
parent02c882bda39f65bdbe7be1b149b74f0f9a8283c6 (diff)
downloadmsgpack-python-e944c1ee93083a054f318e42a16eff699d9f066d.tar.gz
erlang: Only handle throw() in pack/1 and unpack/1
Rationale: We only use throw/1 for error handling, never erlang:error/1. Caller bugs will get a nice {error,...} return while library bugs will bubble up in all their uglyness; that's the proper way to do things in erlang.
-rw-r--r--erlang/msgpack.erl4
1 files changed, 0 insertions, 4 deletions
diff --git a/erlang/msgpack.erl b/erlang/msgpack.erl
index 0e7fb5d..f23ac87 100644
--- a/erlang/msgpack.erl
+++ b/erlang/msgpack.erl
@@ -39,8 +39,6 @@ pack(Term)->
try
pack_(Term)
catch
- error:Error when is_tuple(Error), element(1, Error) =:= error ->
- Error;
throw:Exception ->
{error, Exception}
end.
@@ -54,8 +52,6 @@ unpack(Bin) when is_binary(Bin) ->
try
unpack_(Bin)
catch
- error:Error when is_tuple(Error), element(1, Error) =:= error ->
- Error;
throw:Exception ->
{error, Exception}
end;