diff options
author | Micael Karlberg <[email protected]> | 2013-05-24 15:40:46 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2013-05-24 15:40:46 +0200 |
commit | 49d1609d1ccdd967f20140a2285f118df887f3e9 (patch) | |
tree | 6d36717b89db8e28edd94f7d4971447d0c93542e /lib/snmp/src/agent | |
parent | 246afa772b2fed132ee236fe335045164a8de56f (diff) | |
download | otp-49d1609d1ccdd967f20140a2285f118df887f3e9.tar.gz otp-49d1609d1ccdd967f20140a2285f118df887f3e9.tar.bz2 otp-49d1609d1ccdd967f20140a2285f118df887f3e9.zip |
[snmp/agent] Improved mib-storage ets module error handling
Also fixed some of the debug printouts.
Diffstat (limited to 'lib/snmp/src/agent')
-rw-r--r-- | lib/snmp/src/agent/snmpa_mib_storage_ets.erl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/snmp/src/agent/snmpa_mib_storage_ets.erl b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl index 852df06fa0..04faf46864 100644 --- a/lib/snmp/src/agent/snmpa_mib_storage_ets.erl +++ b/lib/snmp/src/agent/snmpa_mib_storage_ets.erl @@ -89,13 +89,14 @@ open(Name, RecName, _Fields, Type, Opts) -> checksum = Checksum}}; {error, Reason} when (Action =:= keep) -> ?vinfo("open ~p database ~p - " - "failed reading from file (keep)", + "failed reading from file (keep): " + "~n ~p", [Type, Name, Reason]), {error, {file2tab, Reason}}; {error, Reason} -> ?vlog("open ~p database ~p - " - "failed reading from file (clear)", - [Type, Name, Reason]), + "failed reading from file (clear): " + "~n ~p", [Type, Name, Reason]), user_err("Warning: could not read file - " "create new (empty): " "~n File: ~p" @@ -120,15 +121,17 @@ open(Name, RecName, _Fields, Type, Opts) -> checksum = Checksum}}; {error, Reason} when (Action =:= keep) -> ?vinfo("open ~p database ~p - " - "failed reading file info (keep)", + "failed reading file info (keep): " + "~n ~p", [Type, Name, Reason]), {error, {read_file_info, Reason}}; {error, Reason} -> ?vlog("open ~p database ~p - " - "failed reading file info (clear)", + "failed reading file info (clear): " + "~n ~p", [Type, Name, Reason]), user_err("Warning: could not read file info - " - "create new: " + "create new file: " "~n File: ~p" "~n Reason: ~p", [File, Reason]), ID = ets:new(Name, [Type, protected, {keypos, 2}]), |