diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-17 12:13:56 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-17 12:13:56 +0200 |
commit | 56432d661e34de9aa0d1727fb7b06f19aa18723e (patch) | |
tree | 11cd9f4272afae4867496dc942f35866718d2a7c /src | |
parent | dddcf192c7c9d3a4cb19e7523d81ed2b11d560ad (diff) | |
download | pianobar-56432d661e34de9aa0d1727fb7b06f19aa18723e.tar.gz pianobar-56432d661e34de9aa0d1727fb7b06f19aa18723e.tar.bz2 pianobar-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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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); |