diff options
author | Max Kellermann <max@duempel.org> | 2013-08-10 18:02:44 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-04 18:14:22 +0200 |
commit | 29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch) | |
tree | 79766830b55ebca38ddbce84d8d548227eedb69e /src/QueueCommands.cxx | |
parent | c9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff) | |
download | mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip |
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/QueueCommands.cxx')
-rw-r--r-- | src/QueueCommands.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/QueueCommands.cxx b/src/QueueCommands.cxx index 683a88e50..a70a5f250 100644 --- a/src/QueueCommands.cxx +++ b/src/QueueCommands.cxx @@ -32,6 +32,7 @@ #include "protocol/Result.hxx" #include "ls.hxx" #include "util/UriUtil.hxx" +#include "util/Error.hxx" #include "fs/Path.hxx" #include <string.h> @@ -52,8 +53,8 @@ handle_add(Client *client, gcc_unused int argc, char *argv[]) return COMMAND_RETURN_ERROR; } - GError *error = NULL; - if (!client_allow_file(client, path_fs, &error)) + Error error; + if (!client_allow_file(client, path_fs, error)) return print_error(client, error); result = client->partition.AppendFile(path_utf8); @@ -72,8 +73,8 @@ handle_add(Client *client, gcc_unused int argc, char *argv[]) } const DatabaseSelection selection(uri, true); - GError *error = NULL; - return AddFromDatabase(client->partition, selection, &error) + Error error; + return AddFromDatabase(client->partition, selection, error) ? COMMAND_RETURN_OK : print_error(client, error); } @@ -95,8 +96,8 @@ handle_addid(Client *client, int argc, char *argv[]) return COMMAND_RETURN_ERROR; } - GError *error = NULL; - if (!client_allow_file(client, path_fs, &error)) + Error error; + if (!client_allow_file(client, path_fs, error)) return print_error(client, error); result = client->partition.AppendFile(path_utf8, &added_id); |