From 6d955c8377f4df9c215424349050b38b8c7628b4 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 7 May 2019 12:47:49 +0200 Subject: [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 --- lib/snmp/src/agent/snmp_community_mib.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/snmp/src/agent/snmp_community_mib.erl') diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl index 9fd7b30f9f..984b0bcee1 100644 --- a/lib/snmp/src/agent/snmp_community_mib.erl +++ b/lib/snmp/src/agent/snmp_community_mib.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2016. All Rights Reserved. +%% Copyright Ericsson AB 1999-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. @@ -206,10 +206,10 @@ do_add_community(Community) -> {error, create_failed} end catch - {error, Reason} -> - {error, Reason}; - Class:Reason -> - {error, {Class, Reason, erlang:get_stacktrace()}} + throw:{error, _} = ERROR -> + ERROR; + C:E:S -> + {error, {C, E, S}} end. %% FIXME: does not work with mnesia -- cgit v1.2.3