diff options
author | Fredrik Gustafsson <[email protected]> | 2012-12-06 13:49:40 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2012-12-06 13:49:40 +0100 |
commit | 1f1818d49ccb5bf1a04fadace100a3e3cf95b52f (patch) | |
tree | 2b4a0a6cc1726cd169234058e471fa2350a1a1d9 /lib/eldap/src | |
parent | 824990f45c3baf16c1e01ff20db1a6844b6d2a3b (diff) | |
parent | 5bbc7504547ad15d65a4e7d55f6706cb52c4c150 (diff) | |
download | otp-1f1818d49ccb5bf1a04fadace100a3e3cf95b52f.tar.gz otp-1f1818d49ccb5bf1a04fadace100a3e3cf95b52f.tar.bz2 otp-1f1818d49ccb5bf1a04fadace100a3e3cf95b52f.zip |
Merge branch 'fredrik/eldap/fix-dialyzer-warnings-r16'
* fredrik/eldap/fix-dialyzer-warnings-r16:
Bumped version number
Changed structure to fix dialyzer warnings eldap.erl
Diffstat (limited to 'lib/eldap/src')
-rw-r--r-- | lib/eldap/src/eldap.erl | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/eldap/src/eldap.erl b/lib/eldap/src/eldap.erl index 699dfc8791..b3249d4f56 100644 --- a/lib/eldap/src/eldap.erl +++ b/lib/eldap/src/eldap.erl @@ -700,20 +700,22 @@ recv_response(S, Data) -> Error -> throw(Error) end; {error,Reason} -> - throw({gen_tcp_error, Reason}); - Error -> - throw(Error) + throw({gen_tcp_error, Reason}) end. %%% Sanity check of received packet check_tag(Data) -> - case asn1rt_ber_bin:decode_tag(l2b(Data)) of - {_Tag, Data1, _Rb} -> - case asn1rt_ber_bin:decode_length(l2b(Data1)) of - {{_Len, _Data2}, _Rb2} -> ok; - _ -> throw({error,decoded_tag_length}) - end; - _ -> throw({error,decoded_tag}) + try + {_Tag, Data1, _Rb} = asn1rt_ber_bin:decode_tag(l2b(Data)), + try + {{_Len, _Data2}, _Rb2} = asn1rt_ber_bin:decode_length(l2b(Data1)), + ok + catch + _ -> throw({error,decoded_tag_length}) + end + catch + _ -> + throw({error, decoded_tag}) end. %%% Check for expected kind of reply |