Author: andy
Date: Fri Apr 26 12:14:59 2013
New Revision: 1476160
URL: http://svn.apache.org/r1476160
Log:
Carefully get the body of 400/500 for the error message but keep going if the
body is bad in someway.
Modified:
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
Modified:
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java?rev=1476160&r1=1476159&r2=1476160&view=diff
==============================================================================
---
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
(original)
+++
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
Fri Apr 26 12:14:59 2013
@@ -431,13 +431,17 @@ public class HttpQuery extends Params
{
InputStream x = httpConnection.getErrorStream() ;
+ String str = null ;
if ( x != null )
{
//String ct = httpConnection.getContentType() ;
//httpConnection.getContentEncoding() ;
- String str = FileUtils.readWholeFileAsUTF8(x) ;
- throw new QueryExceptionHTTP(responseCode,
responseMessage+"\n"+str) ;
+
+ try { str = FileUtils.readWholeFileAsUTF8(x) ; }
+ catch (Throwable ex) {}
}
+ if ( str != null )
+ throw new QueryExceptionHTTP(responseCode,
responseMessage+"\n"+str) ;
else
throw new QueryExceptionHTTP(responseCode,
responseMessage) ;
}