openamf/src/java/org/openamf DefaultGateway.java,1.58,1.59

Sean Sullivan <[email protected]> Wed, 04 Aug 2004 05:22:08 +0000
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/src/java/org/openamf
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17623/src/java/org/openamf

Modified Files:
	DefaultGateway.java 
Log Message:
improved exception logging


Index: DefaultGateway.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/DefaultGateway.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** DefaultGateway.java	24 Jun 2004 00:34:53 -0000	1.58
--- DefaultGateway.java	4 Aug 2004 05:22:06 -0000	1.59
***************
*** 78,82 ****
  		initializeRequestContext(req);
  		
! 		AMFMessage requestMessage, responseMessage = null;
  		
  		try {
--- 78,83 ----
  		initializeRequestContext(req);
  		
! 		AMFMessage requestMessage = null;
! 		AMFMessage responseMessage = null;
  		
  		try {
***************
*** 102,106 ****
  			serializeAMFMessage(resp, responseMessage);
  		} catch (Exception e) {
! 			processRequestException(e);
  		}
  		finally {
--- 103,107 ----
  			serializeAMFMessage(resp, responseMessage);
  		} catch (Exception e) {
! 			processRequestException(e, requestMessage);
  		}
  		finally {
***************
*** 109,120 ****
  	}
  
! 	protected void processRequestException(Exception e)
  	{
! 		log.error("Error in service: " + e, e);
  	}
  
  	protected void processServiceInvocationException(ServiceInvocationException e)
  	{
! 		log.warn("service invocation", e);
  	}
  
--- 110,146 ----
  	}
  
! 	protected void processRequestException(Exception e, AMFMessage requestMessage)
  	{
! 		String msg = "Error in service"; 
! 		
! 		if (requestMessage != null)
! 		{
! 			msg += ", requestMessage=";
! 			msg += String.valueOf(requestMessage);
! 		}
! 		
! 		log.error(msg, e); 
  	}
  
  	protected void processServiceInvocationException(ServiceInvocationException e)
  	{
! 		AMFBody body = e.getAMFBody();
! 		ServiceRequest req = e.getServiceRequest();
! 		
! 		String msg = "service invocation";
! 		
! 		if (body != null)
! 		{
! 			msg += ", AMFBody=";
! 			msg += String.valueOf(body);
! 		}
! 		
! 		if (req != null)
! 		{
! 			msg += ", ServiceRequest=";
! 			msg += String.valueOf(req);
! 		}
! 		
! 		log.warn(msg, e);
  	}
  



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com