Software /
code /
prosody
Comparison
core/configmanager.lua @ 793:55add3b87c01
Report errors in the config file to the user
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 13 Feb 2009 14:37:15 +0000 |
parent | 760:90ce865eebd8 |
child | 794:912dc389935a |
comparison
equal
deleted
inserted
replaced
792:57c793b1575f | 793:55add3b87c01 |
---|---|
66 if parsers[format] and parsers[format].load then | 66 if parsers[format] and parsers[format].load then |
67 local f, err = io.open(filename); | 67 local f, err = io.open(filename); |
68 if f then | 68 if f then |
69 local ok, err = parsers[format].load(f:read("*a")); | 69 local ok, err = parsers[format].load(f:read("*a")); |
70 f:close(); | 70 f:close(); |
71 return ok, err; | 71 return ok, "parser", err; |
72 end | 72 end |
73 return f, err; | 73 return f, "file", err; |
74 end | 74 end |
75 | 75 |
76 if not format then | 76 if not format then |
77 return nil, "no parser specified"; | 77 return nil, "file", "no parser specified"; |
78 else | 78 else |
79 return nil, "no parser for "..(format); | 79 return nil, "file", "no parser for "..(format); |
80 end | 80 end |
81 end | 81 end |
82 | 82 |
83 function save(filename, format) | 83 function save(filename, format) |
84 end | 84 end |