summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-27 18:02:27 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-27 18:02:27 +0100
commit6f02b03ebc28de6c8d19599d7aa0a9066f9d83ee (patch)
tree19ac5c93a2eb9d14adf1e474b21899aec8064d10
parent68abe4cde4cdae13018bf23dae1926975b9cdefa (diff)
downloadpianobar-6f02b03ebc28de6c8d19599d7aa0a9066f9d83ee.tar.gz
pianobar-6f02b03ebc28de6c8d19599d7aa0a9066f9d83ee.tar.bz2
pianobar-6f02b03ebc28de6c8d19599d7aa0a9066f9d83ee.zip
piano: New error STATION_NONEXISTENT
-rw-r--r--libpiano/src/main.c6
-rw-r--r--libpiano/src/piano.h3
-rw-r--r--libpiano/src/xml.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/libpiano/src/main.c b/libpiano/src/main.c
index 6cb6bad..600c74c 100644
--- a/libpiano/src/main.c
+++ b/libpiano/src/main.c
@@ -871,6 +871,7 @@ const char *PianoErrorToStr (PianoReturn_t ret) {
case PIANO_RET_READONLY_MODE:
return "Request cannot be completed at this time, please try "
"again later.";
+ break;
case PIANO_RET_STATION_CODE_INVALID:
return "Station id is invalid.";
@@ -879,6 +880,11 @@ const char *PianoErrorToStr (PianoReturn_t ret) {
case PIANO_RET_IP_REJECTED:
return "Your ip address was rejected. Please setup a control "
"proxy (see manpage).";
+ break;
+
+ case PIANO_RET_STATION_NONEXISTENT:
+ return "Station does not exist";
+ break;
default:
return "No error message available.";
diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h
index d4621b6..db85108 100644
--- a/libpiano/src/piano.h
+++ b/libpiano/src/piano.h
@@ -103,7 +103,8 @@ typedef enum {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_STATION_CODE_INVALID, PIANO_RET_IP_REJECTED} PianoReturn_t;
+ PIANO_RET_STATION_CODE_INVALID, PIANO_RET_IP_REJECTED,
+ PIANO_RET_STATION_NONEXISTENT} PianoReturn_t;
void PianoInit (PianoHandle_t *);
void PianoDestroy (PianoHandle_t *);
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c
index 847bc49..6d3d35a 100644
--- a/libpiano/src/xml.c
+++ b/libpiano/src/xml.c
@@ -78,6 +78,9 @@ void PianoXmlIsFaultCb (const char *key, const xmlNode *value, void *data) {
} else if (strcmp ("STATION_CODE_INVALID",
matchStr) == 0) {
*ret = PIANO_RET_STATION_CODE_INVALID;
+ } else if (strcmp ("STATION_DOES_NOT_EXIST",
+ matchStr) == 0) {
+ *ret = PIANO_RET_STATION_NONEXISTENT;
} else {
*ret = PIANO_RET_ERR;
printf (PACKAGE ": Unknown error %s in %s\n",