From 785819ed369fae59aef20a09779eaa0a627a8709 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 13 Dec 2008 21:24:55 +0100 Subject: piano: New error STATION_CODE_INVALID --- libpiano/src/main.c | 4 ++++ libpiano/src/piano.h | 4 ++-- libpiano/src/xml.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'libpiano') diff --git a/libpiano/src/main.c b/libpiano/src/main.c index de954ec..fd0a4bc 100644 --- a/libpiano/src/main.c +++ b/libpiano/src/main.c @@ -864,6 +864,10 @@ const char *PianoErrorToStr (PianoReturn_t ret) { return "Request cannot be completed at this time, please try " "again later."; + case PIANO_RET_STATION_CODE_INVALID: + return "Station id is invalid."; + break; + default: return "No error message available."; break; diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h index f311743..e294b4a 100644 --- a/libpiano/src/piano.h +++ b/libpiano/src/piano.h @@ -149,11 +149,11 @@ struct PianoSearchResult { 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_PROTOCOL_INCOMPATIBLE, PIANO_RET_READONLY_MODE}; + PIANO_RET_PROTOCOL_INCOMPATIBLE, PIANO_RET_READONLY_MODE, + PIANO_RET_STATION_CODE_INVALID}; typedef enum PianoReturn PianoReturn_t; void PianoInit (PianoHandle_t *); diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index 2b33fe3..a07542b 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -70,6 +70,9 @@ void PianoXmlIsFaultCb (const char *key, const xmlNode *value, void *data) { *ret = PIANO_RET_PROTOCOL_INCOMPATIBLE; } else if (strcmp ("READONLY_MODE", matchStr) == 0) { *ret = PIANO_RET_READONLY_MODE; + } else if (strcmp ("STATION_CODE_INVALID", + matchStr) == 0) { + *ret = PIANO_RET_STATION_CODE_INVALID; } else { *ret = PIANO_RET_ERR; printf (PACKAGE ": Unknown error %s in %s\n", -- cgit v1.2.3