aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_per.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-01-10 12:15:43 +0100
committerBjörn Gustavsson <[email protected]>2013-01-22 19:20:11 +0100
commit70caf52f1a7e09569c776bb1f99b0bf4737c63c2 (patch)
tree252d673222be3061d07ecf8148bab3357f792816 /lib/asn1/src/asn1rtt_per.erl
parent844e2126e3b814f9fa058be367be3af745c7a80b (diff)
downloadotp-70caf52f1a7e09569c776bb1f99b0bf4737c63c2.tar.gz
otp-70caf52f1a7e09569c776bb1f99b0bf4737c63c2.tar.bz2
otp-70caf52f1a7e09569c776bb1f99b0bf4737c63c2.zip
Correct error handling for the NIF functions
Also make sure that the error handling is contained within the asn1rt_nif module and does not leak out to generated code.
Diffstat (limited to 'lib/asn1/src/asn1rtt_per.erl')
-rw-r--r--lib/asn1/src/asn1rtt_per.erl12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index d545c8a854..8234121934 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -1311,17 +1311,7 @@ get_constraint(C,Key) ->
%%
complete(L) ->
- case asn1rt_nif:encode_per_complete(L) of
- {error, Reason} -> handle_error(Reason, L);
- Else when is_binary(Else) -> Else
- end.
-
-handle_error([],_)->
- exit({error,{asn1,{"memory allocation problem in driver"}}});
-handle_error($1,L) -> % error in complete in driver
- exit({error,{asn1,L}});
-handle_error(ErrL,L) ->
- exit({error,{asn1,ErrL,L}}).
+ asn1rt_nif:encode_per_complete(L).
octets_to_complete(Len,Val) when Len < 256 ->
[20,Len,Val];