Improved exception logging.

This commit is contained in:
Simone Bordet 2012-06-04 15:56:32 +02:00
parent f0c2fd2474
commit 20c0f23cc7
2 changed files with 86 additions and 22 deletions

View File

@ -491,7 +491,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
} }
@ -522,7 +527,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
} }
@ -665,7 +675,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception xx) catch (Exception xx)
{ {
logger.info("Exception while notifying listener " + listener,xx); logger.info("Exception while notifying listener " + listener, xx);
}
catch (Error xx)
{
logger.info("Exception while notifying listener " + listener, xx);
throw xx;
} }
} }
@ -673,17 +688,21 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
{ {
try try
{ {
if (listener != null) if (listener == null)
{ return null;
logger.debug("Invoking callback with {} on listener {}",synInfo,listener); logger.debug("Invoking callback with {} on listener {}",synInfo,listener);
return listener.onSyn(stream,synInfo); return listener.onSyn(stream,synInfo);
}
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener,x);
return null;
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
return null;
} }
private void notifyOnRst(SessionFrameListener listener, RstInfo rstInfo) private void notifyOnRst(SessionFrameListener listener, RstInfo rstInfo)
@ -698,7 +717,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -714,7 +738,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -730,7 +759,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -746,7 +780,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -1000,7 +1039,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying handler " + handler,x); logger.info("Exception while notifying handler " + handler, x);
}
catch (Error x)
{
logger.info("Exception while notifying handler " + handler, x);
throw x;
} }
} }
@ -1013,7 +1057,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
} }
catch (Exception xx) catch (Exception xx)
{ {
logger.info("Exception while notifying handler " + handler,xx); logger.info("Exception while notifying handler " + handler, xx);
}
catch (Error xx)
{
logger.info("Exception while notifying handler " + handler, xx);
throw xx;
} }
} }

View File

@ -247,13 +247,18 @@ public class StandardStream implements IStream
{ {
if (listener != null) if (listener != null)
{ {
logger.debug("Invoking reply callback with {} on listener {}",replyInfo,listener); logger.debug("Invoking reply callback with {} on listener {}", replyInfo, listener);
listener.onReply(this,replyInfo); listener.onReply(this, replyInfo);
} }
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -264,13 +269,18 @@ public class StandardStream implements IStream
{ {
if (listener != null) if (listener != null)
{ {
logger.debug("Invoking headers callback with {} on listener {}",frame,listener); logger.debug("Invoking headers callback with {} on listener {}", frame, listener);
listener.onHeaders(this, headersInfo); listener.onHeaders(this, headersInfo);
} }
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }
@ -281,14 +291,19 @@ public class StandardStream implements IStream
{ {
if (listener != null) if (listener != null)
{ {
logger.debug("Invoking data callback with {} on listener {}",dataInfo,listener); logger.debug("Invoking data callback with {} on listener {}", dataInfo, listener);
listener.onData(this, dataInfo); listener.onData(this, dataInfo);
logger.debug("Invoked data callback with {} on listener {}", dataInfo, listener); logger.debug("Invoked data callback with {} on listener {}", dataInfo, listener);
} }
} }
catch (Exception x) catch (Exception x)
{ {
logger.info("Exception while notifying listener " + listener,x); logger.info("Exception while notifying listener " + listener, x);
}
catch (Error x)
{
logger.info("Exception while notifying listener " + listener, x);
throw x;
} }
} }