Skip to content

Commit

Permalink
Merge pull request #33 from ricky-shake-n-bake-bobby/master
Browse files Browse the repository at this point in the history
Added MessageBody details to GetInboundImage Failures
  • Loading branch information
ricky-shake-n-bake-bobby authored Mar 5, 2020
2 parents 0dab5f1 + 9dcd647 commit d21f770
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,10 @@ private byte[] getFaxImage(String path) throws UnsuccessfulStatusCodeException {
responseBytes = IOUtils.toByteArray(inputStream);
inputStream.close();
} else {
throw new UnsuccessfulStatusCodeException("Unsuccessful response from API", response.getStatus());
String responseBody = null;
if (response.hasEntity())
responseBody = response.readEntity(String.class);
throw new UnsuccessfulStatusCodeException("Unsuccessful response from API", response.getStatus(), responseBody);
}
} catch (IOException e) {
log.error("Exception occurred while getting fax image", e);
Expand Down Expand Up @@ -711,4 +714,4 @@ private void initializeClient(String username, String password) {
reentrantLock.unlock();
}
}
}
}

0 comments on commit d21f770

Please sign in to comment.