From a7b027068cb070ebf519246917b5409543df212d Mon Sep 17 00:00:00 2001 From: lado Date: Thu, 20 Oct 2011 03:58:45 +0200 Subject: logging --- .../vdrmanager/utils/svdrp/SvdrpClient.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'vdrmanager/src/de/bjusystems') 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 { 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 { // 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 { } catch (final Exception e) { // throw new SvdrpException(e); + Log.w(TAG, e); informListener(SvdrpEvent.FINISHED_ABNORMALY, null); } } -- cgit v1.2.3