summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-17 12:13:56 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-17 12:13:56 +0200
commit56432d661e34de9aa0d1727fb7b06f19aa18723e (patch)
tree11cd9f4272afae4867496dc942f35866718d2a7c /src
parentdddcf192c7c9d3a4cb19e7523d81ed2b11d560ad (diff)
downloadpianobar-windows-56432d661e34de9aa0d1727fb7b06f19aa18723e.tar.gz
pianobar-windows-56432d661e34de9aa0d1727fb7b06f19aa18723e.tar.bz2
pianobar-windows-56432d661e34de9aa0d1727fb7b06f19aa18723e.zip
More error handling.
Now we can parse and handle pandora's <fault> messages and abort the parsing process. Some more fault type should be added, as well as more client support for those errors.
Diffstat (limited to 'src')
-rw-r--r--src/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index a1041e7..134e9ad 100644
--- a/src/main.c
+++ b/src/main.c
@@ -302,9 +302,16 @@ int main (int argc, char **argv) {
termSetBuffer (0);
printf ("Login...\n");
- PianoConnect (&ph, bsettings.username, bsettings.password);
+ if (PianoConnect (&ph, bsettings.username, bsettings.password) !=
+ PIANO_RET_OK) {
+ printf ("Login failed. Check your username and password\n");
+ return 0;
+ }
printf ("Get stations...\n");
- PianoGetStations (&ph);
+ if (PianoGetStations (&ph) != PIANO_RET_OK) {
+ printf ("Error while fetching your stations.\n");
+ return 0;
+ }
/* select station */
curStation = selectStation (&ph);