aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigGlobal.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/ConfigGlobal.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/ConfigGlobal.cxx')
-rw-r--r--src/ConfigGlobal.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx
index 1f89a1283..0bf2b4433 100644
--- a/src/ConfigGlobal.cxx
+++ b/src/ConfigGlobal.cxx
@@ -24,6 +24,7 @@
#include "ConfigFile.hxx"
#include "ConfigPath.hxx"
#include "fs/Path.hxx"
+#include "util/Error.hxx"
#include "mpd_error.h"
#include <glib.h>
@@ -47,9 +48,9 @@ void config_global_init(void)
}
bool
-ReadConfigFile(const Path &path, GError **error_r)
+ReadConfigFile(const Path &path, Error &error)
{
- return ReadConfigFile(config_data, path, error_r);
+ return ReadConfigFile(config_data, path, error);
}
static void
@@ -98,20 +99,16 @@ config_get_string(ConfigOption option, const char *default_value)
}
Path
-config_get_path(ConfigOption option, GError **error_r)
+config_get_path(ConfigOption option, Error &error)
{
- assert(error_r != NULL);
- assert(*error_r == NULL);
-
const struct config_param *param = config_get_param(option);
if (param == NULL)
return Path::Null();
- Path path = ParsePath(param->value, error_r);
+ Path path = ParsePath(param->value, error);
if (gcc_unlikely(path.IsNull()))
- g_prefix_error(error_r,
- "Invalid path at line %i: ",
- param->line);
+ error.FormatPrefix("Invalid path at line %i: ",
+ param->line);
return path;
}