From c5a16ad3551a87a9bb361a8bce220cb849247d43 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 5 Mar 2012 14:07:35 +0100 Subject: [snmp/agent] Some minor improvements to the error messages OTP-9943 --- lib/snmp/src/agent/snmp_standard_mib.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/snmp/src/agent/snmp_standard_mib.erl') diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl index 7c78e03b3b..ca93546923 100644 --- a/lib/snmp/src/agent/snmp_standard_mib.erl +++ b/lib/snmp/src/agent/snmp_standard_mib.erl @@ -156,7 +156,7 @@ read_standard(Dir) -> Gen = fun(D, Reason) -> throw({error, {failed_reading_config_file, D, FileName, - file:list_dir(Dir), Reason}}) + list_dir(Dir), Reason}}) end, Filter = fun(Standard) -> sort_standard(Standard) end, Check = fun(Entry) -> check_standard(Entry) end, @@ -164,6 +164,14 @@ read_standard(Dir) -> snmp_conf:read_files(Dir, [{Gen, Filter, Check, FileName}]), Standard. +list_dir(Dir) -> + case file:list_dir(Dir) of + {ok, Files} -> + Files; + Error -> + Error + end. + %%----------------------------------------------------------------- %% Make sure that each mandatory standard attribute is present, and -- cgit v1.2.3