You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2013/04/26 14:15:00 UTC
svn commit: r1476160 -
/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/http/HttpQuery.java
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) ;
}