From 858ecd45441218b20c2592a0f27ff247e9425bba Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Wed, 20 Aug 2008 10:47:31 +0200 Subject: piano: New error INCOMPATIBLE_VERSION Raised when pandora bumps their protocol url/version --- libpiano/src/main.c | 4 ++++ libpiano/src/piano.h | 3 ++- libpiano/src/xml.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libpiano') diff --git a/libpiano/src/main.c b/libpiano/src/main.c index 33cd5df..f7aebc5 100644 --- a/libpiano/src/main.c +++ b/libpiano/src/main.c @@ -853,6 +853,10 @@ const char *PianoErrorToStr (PianoReturn_t ret) { return "Not authorized."; break; + case PIANO_RET_PROTOCOL_INCOMPATIBLE: + return "Protocol incompatible. Please upgrade " PACKAGE_NAME "."; + break; + default: return "No error message available."; break; diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h index ae4b18b..8160b2c 100644 --- a/libpiano/src/piano.h +++ b/libpiano/src/piano.h @@ -152,7 +152,8 @@ typedef struct PianoSearchResult PianoSearchResult_t; /* FIXME: more error types (http failed, e.g.) later */ enum PianoReturn {PIANO_RET_OK, PIANO_RET_ERR, PIANO_RET_XML_INVALID, PIANO_RET_AUTH_TOKEN_INVALID, PIANO_RET_AUTH_USER_PASSWORD_INVALID, - PIANO_RET_NET_ERROR, PIANO_RET_NOT_AUTHORIZED}; + PIANO_RET_NET_ERROR, PIANO_RET_NOT_AUTHORIZED, + PIANO_RET_PROTOCOL_INCOMPATIBLE}; typedef enum PianoReturn PianoReturn_t; void PianoInit (PianoHandle_t *); diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index 25cd8f8..f43d4a8 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -65,6 +65,9 @@ void PianoXmlIsFaultCb (const char *key, const xmlNode *value, void *data) { } else if (strcmp ("LISTENER_NOT_AUTHORIZED", matchStr) == 0) { *ret = PIANO_RET_NOT_AUTHORIZED; + } else if (strcmp ("INCOMPATIBLE_VERSION", + matchStr) == 0) { + *ret = PIANO_RET_PROTOCOL_INCOMPATIBLE; } else { *ret = PIANO_RET_ERR; printf (PACKAGE ": Unknown error %s in %s\n", -- cgit v1.2.3