From 56432d661e34de9aa0d1727fb7b06f19aa18723e Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 17 Jun 2008 12:13:56 +0200 Subject: More error handling. Now we can parse and handle pandora's messages and abort the parsing process. Some more fault type should be added, as well as more client support for those errors. --- src/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3