diff options
author | Micael Karlberg <[email protected]> | 2019-05-07 12:47:49 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-05-22 18:20:06 +0200 |
commit | 6d955c8377f4df9c215424349050b38b8c7628b4 (patch) | |
tree | a6209f25e02083390c454cdbfa94734761cd7349 /lib/snmp/src/misc/snmp_conf.erl | |
parent | 55cee8416a689d3adf57fc0b20959c328f8c83bd (diff) | |
download | otp-6d955c8377f4df9c215424349050b38b8c7628b4.tar.gz otp-6d955c8377f4df9c215424349050b38b8c7628b4.tar.bz2 otp-6d955c8377f4df9c215424349050b38b8c7628b4.zip |
[snmp] Remove use of the deprecated get_stacktrace function
Removed the use of the deprecated erlang:stacktrace() function.
Instead make use of the 'catch Class:Error:Stacktrace' feature.
OTP-15332
Diffstat (limited to 'lib/snmp/src/misc/snmp_conf.erl')
-rw-r--r-- | lib/snmp/src/misc/snmp_conf.erl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/snmp/src/misc/snmp_conf.erl b/lib/snmp/src/misc/snmp_conf.erl index 513616a285..d73291764d 100644 --- a/lib/snmp/src/misc/snmp_conf.erl +++ b/lib/snmp/src/misc/snmp_conf.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2016. All Rights Reserved. +%% Copyright Ericsson AB 1996-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -236,15 +236,16 @@ read_check(File, Check, [{StartLine, Row, EndLine}|Lines], State, Res) -> " NewRow: ~p~n", [NewRow]), read_check(File, Check, Lines, NewState, [NewRow | Res]) catch - {error, Reason} -> - ?vtrace("read_check -> error:~n" - " Reason: ~p", [Reason]), + throw:{error, Reason} -> + ?vtrace("read_check -> error:" + "~n Reason: ~p", [Reason]), error({failed_check, File, StartLine, EndLine, Reason}); - Class:Reason -> - Error = {Class,Reason,erlang:get_stacktrace()}, - ?vtrace("read_check -> failure:~n" - " Error: ~p", [Error]), - error({failed_check, File, StartLine, EndLine, Error}) + C:E:S -> + ?vtrace("read_check -> failure:" + "~n Class: ~p" + "~n Error: ~p" + "~n Stack: ~p", [C, E, S]), + error({failed_check, File, StartLine, EndLine, {C, E, S}}) end. open_file(File) -> |