Skip to content

Commit

Permalink
fix error in query runner
Browse files Browse the repository at this point in the history
  • Loading branch information
amattioc committed May 29, 2024
1 parent 85a1197 commit 355037f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240514-1518
20240529-1428
17 changes: 10 additions & 7 deletions JAVA/src/main/java/it/bancaditalia/oss/sdmx/util/QueryRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,17 @@ else if (conn.getContentType() != null && conn.getContentType().contains("applic
}
else
{
LOGGER.severe("Connection error. Code:" + code);
InputStream stream = ((HttpURLConnection) conn).getErrorStream();
String encoding = conn.getContentEncoding() == null ? "" : conn.getContentEncoding();
if (encoding.equalsIgnoreCase("gzip"))
stream = new GZIPInputStream(stream);
else if (encoding.equalsIgnoreCase("deflate"))
stream = new InflaterInputStream(stream);
String msg = new BufferedReader(new InputStreamReader(stream)).lines().collect(joining(lineSeparator()));
LOGGER.severe(msg);
if(stream != null){
String encoding = conn.getContentEncoding() == null ? "" : conn.getContentEncoding();
if (encoding.equalsIgnoreCase("gzip"))
stream = new GZIPInputStream(stream);
else if (encoding.equalsIgnoreCase("deflate"))
stream = new InflaterInputStream(stream);
String msg = new BufferedReader(new InputStreamReader(stream)).lines().collect(joining(lineSeparator()));
LOGGER.severe("Message:" + msg);
}
SdmxException ex = SdmxExceptionFactory.createRestException(code, null, null);
if (conn instanceof HttpURLConnection)
((HttpURLConnection) conn).disconnect();
Expand Down
Binary file modified RJSDMX/inst/java/SDMX.jar
Binary file not shown.
Binary file modified STATA/jar/SDMX.jar
Binary file not shown.

0 comments on commit 355037f

Please sign in to comment.