diff options
author | lado <herrlado@gmail.com> | 2011-10-20 03:58:45 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-20 03:58:45 +0200 |
commit | a7b027068cb070ebf519246917b5409543df212d (patch) | |
tree | 98892535acb62859b45f804b962bdde7ac638f5b /vdrmanager/src | |
parent | 4dcadc5fc5ad5172d90c90290830607c32f88243 (diff) | |
download | vdr-manager-a7b027068cb070ebf519246917b5409543df212d.tar.gz vdr-manager-a7b027068cb070ebf519246917b5409543df212d.tar.bz2 |
logging
Diffstat (limited to 'vdrmanager/src')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java index 374e2de..5f04578 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/SvdrpClient.java @@ -236,11 +236,13 @@ public abstract class SvdrpClient<Result> { informListener(SvdrpEvent.COMMAND_SENDING, null); writeLine(command); informListener(SvdrpEvent.COMMAND_SENT, null); - + Log.i(TAG, SvdrpEvent.COMMAND_SENT +":" + command); + // read first line String line = readLine(); if (!line.startsWith("START")) { - throw new IOException("Answer not wellformed"); + Log.w(TAG,line); + throw new IOException("Answer not wellformed: " + line); } // read answer lines @@ -259,12 +261,22 @@ public abstract class SvdrpClient<Result> { // error? if (line.startsWith("!ERROR")) { + Log.w(TAG, line); informListener(SvdrpEvent.ERROR, null); break; } // delegate analysis - final Result result = parseAnswer(line); + Result result = null; + try { + result = parseAnswer(line); + } catch(Exception ex){ + Log.w(TAG, ex); + Log.w(TAG, "line: " + line); + informListener(SvdrpEvent.ERROR, null); + disconnect(); + break; + } if (result != null) { results.add(result); if (resultInfoEnabled) { @@ -281,6 +293,7 @@ public abstract class SvdrpClient<Result> { } catch (final Exception e) { // throw new SvdrpException(e); + Log.w(TAG, e); informListener(SvdrpEvent.FINISHED_ABNORMALY, null); } } |