aboutsummaryrefslogtreecommitdiffstats
path: root/lib/eldap
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-11-29 17:08:52 +0100
committerFredrik Gustafsson <[email protected]>2012-11-29 17:08:52 +0100
commit6b91aa59d08b788d71f95e8df9243c43a495b5f3 (patch)
treec13051f713a032249ee694f2b5ccfc68eda51946 /lib/eldap
parentc4d680549e11e116dcdd95ac29101ef3e54aba5f (diff)
downloadotp-6b91aa59d08b788d71f95e8df9243c43a495b5f3.tar.gz
otp-6b91aa59d08b788d71f95e8df9243c43a495b5f3.tar.bz2
otp-6b91aa59d08b788d71f95e8df9243c43a495b5f3.zip
Changed structure to fix dialyzer warnings eldap.erl
Diffstat (limited to 'lib/eldap')
-rw-r--r--lib/eldap/src/eldap.erl22
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