aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2013-05-24 15:40:46 +0200
committerMicael Karlberg <[email protected]>2013-05-24 15:40:46 +0200
commit49d1609d1ccdd967f20140a2285f118df887f3e9 (patch)
tree6d36717b89db8e28edd94f7d4971447d0c93542e /lib/snmp
parent246afa772b2fed132ee236fe335045164a8de56f (diff)
downloadotp-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')
-rw-r--r--lib/snmp/src/agent/snmpa_mib_storage_ets.erl15
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}]),