aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigData.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/ConfigData.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/ConfigData.cxx')
-rw-r--r--src/ConfigData.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ConfigData.cxx b/src/ConfigData.cxx
index 2ed8e2f3b..84a726799 100644
--- a/src/ConfigData.cxx
+++ b/src/ConfigData.cxx
@@ -21,6 +21,7 @@
#include "ConfigData.hxx"
#include "ConfigParser.hxx"
#include "ConfigPath.hxx"
+#include "util/Error.hxx"
#include "fs/Path.hxx"
#include "system/FatalError.hxx"
#include "mpd_error.h"
@@ -97,10 +98,9 @@ config_param::DupBlockString(const char *name, const char *default_value) const
Path
config_param::GetBlockPath(const char *name, const char *default_value,
- GError **error_r) const
+ Error &error) const
{
- assert(error_r != nullptr);
- assert(*error_r == nullptr);
+ assert(!error.IsDefined());
int line2 = line;
const char *s;
@@ -112,19 +112,18 @@ config_param::GetBlockPath(const char *name, const char *default_value,
} else
s = default_value;
- Path path = ParsePath(s, error_r);
+ Path path = ParsePath(s, error);
if (gcc_unlikely(path.IsNull()))
- g_prefix_error(error_r,
- "Invalid path in \"%s\" at line %i: ",
- name, line2);
+ error.FormatPrefix("Invalid path in \"%s\" at line %i: ",
+ name, line2);
return path;
}
Path
-config_param::GetBlockPath(const char *name, GError **error_r) const
+config_param::GetBlockPath(const char *name, Error &error) const
{
- return GetBlockPath(name, nullptr, error_r);
+ return GetBlockPath(name, nullptr, error);
}
unsigned