W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2009

2006/unicorn/src/org/w3c/unicorn/response/parser ResponseParserFactory.java,1.3,1.4

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 21 Sep 2009 12:09:33 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Mphi1-00083h-4w@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/parser
In directory hutz:/tmp/cvs-serv30963/src/org/w3c/unicorn/response/parser

Modified Files:
	ResponseParserFactory.java 
Log Message:
added error logs

Index: ResponseParserFactory.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/parser/ResponseParserFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ResponseParserFactory.java	3 Sep 2009 16:43:20 -0000	1.3
+++ ResponseParserFactory.java	21 Sep 2009 12:09:31 -0000	1.4
@@ -4,6 +4,8 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.w3c.unicorn.Framework;
 import org.w3c.unicorn.response.Response;
 import org.xml.sax.SAXException;
@@ -14,6 +16,8 @@
  */
 public class ResponseParserFactory {
 
+	private static Log logger = LogFactory.getLog(ResponseParserFactory.class);
+	
 	/**
 	 * Creates a parser corresponding to the type of the response.
 	 * 
@@ -43,16 +47,18 @@
 	 * @return The response parsed corresponding to the input.
 	 * @throws Exception 
 	 */
-	public static Response parse(String r, String responseType) throws Exception {
+	public static Response parse(String r, String responseType) {
 		try {
 			Response response = createResponseParser(responseType).parse(r);
 			return response;
 		} catch (SAXException e) {
-			e.printStackTrace();
+			logger.error(e.getMessage(), e);
 		} catch (ParserConfigurationException e) {
-			e.printStackTrace();
+			logger.error(e.getMessage(), e);
 		} catch (IOException e) {
-			e.printStackTrace();
+			logger.error(e.getMessage(), e);
+		} catch (Exception e) {
+			logger.error(e.getMessage(), e);
 		}
 		return null;
 	}
Received on Monday, 21 September 2009 12:09:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:14 GMT