From 49d1609d1ccdd967f20140a2285f118df887f3e9 Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Fri, 24 May 2013 15:40:46 +0200
Subject: [snmp/agent] Improved mib-storage ets module error handling

Also fixed some of the debug printouts.
---
 lib/snmp/src/agent/snmpa_mib_storage_ets.erl | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

(limited to 'lib')

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}]),
-- 
cgit v1.2.3