Commit e9f1b53a authored by Max Kellermann's avatar Max Kellermann

command, ack: add ack_quark()

To pass ack values around.
parent 5016839b
......@@ -20,6 +20,8 @@
#ifndef MPD_ACK_H
#define MPD_ACK_H
#include <glib.h>
enum ack {
ACK_ERROR_NOT_LIST = 1,
ACK_ERROR_ARG = 2,
......@@ -36,4 +38,14 @@ enum ack {
ACK_ERROR_EXIST = 56,
};
/**
* Quark for GError.domain; the code is an enum #ack.
*/
G_GNUC_CONST
static inline GQuark
ack_quark(void)
{
return g_quark_from_static_string("ack");
}
#endif
......@@ -183,6 +183,10 @@ print_error(struct client *client, GError *error)
enum playlist_result result = error->code;
g_error_free(error);
return print_playlist_result(client, result);
} else if (error->domain == ack_quark()) {
command_error(client, error->code, "%s", error->message);
g_error_free(error);
return COMMAND_RETURN_ERROR;
} else if (error->domain == db_quark()) {
switch ((enum db_error)error->code) {
case DB_DISABLED:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment