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/QueueCommands.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/QueueCommands.cxx') 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 @@ -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); -- cgit v1.2.3