From 29030b54c98b0aee65fbc10ebf7ba36bed98c02c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 18:02:44 +0200 Subject: util/Error: new error passing library Replaces GLib's GError. --- src/ConfigData.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/ConfigData.cxx') 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 -- cgit v1.2.3