From: Florent G. <li...@fg...> - 2012-10-23 16:56:08
|
Hi, What do you think of the following patch? As I explained in another email, it seems the eXist HTTP Client is generating a stacktrace in the logs every time the content of an HTTP response is not XML, while it should be (at most) an info line. Is my understanding correct? Should I commit it? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ Index: extensions/modules/src/org/exist/xquery/modules/httpclient/BaseHTTPClientFunction.java =================================================================== --- extensions/modules/src/org/exist/xquery/modules/httpclient/BaseHTTPClientFunction.java(revision 17312) +++ extensions/modules/src/org/exist/xquery/modules/httpclient/BaseHTTPClientFunction.java(working copy) @@ -348,10 +348,12 @@ builder.addAttribute( new QName( "type", null, null ), "xml" ); responseNode.copyTo( null, new DocumentBuilderReceiver( builder ) ); } catch(SAXException se) { - //could not parse to xml - logger.info("Request for URI '" + method.getURI().toString() + "' Could not parse http response content as XML: " + se.getMessage(), se); + // could not parse to xml + // not an error in itself, it will be treated either as HTML, + // text or binary here below + logger.info("Request for URI '" + method.getURI().toString() + "' Could not parse http response content as XML (will try html, text or fallback to binary): " + se.getMessage()); } catch(IOException ioe) { - String msg = "Request for URI '" + method.getURI().toString() + "' Could not parse http response content as XML: " + ioe.getMessage(); + String msg = "Request for URI '" + method.getURI().toString() + "' Could not read http response content: " + ioe.getMessage(); logger.error(msg, ioe); throw new XPathException(msg, ioe); } |