Skip to content

Commit

Permalink
better exception handling for letter validation. increased wait time …
Browse files Browse the repository at this point in the history
…for validation result. issue #54
  • Loading branch information
j-dimension committed Jan 4, 2024
1 parent dd4e7eb commit 4ad20dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Binary file modified j-lawyer-client/lib/j-lawyer-cloud/j-lawyer-cloud.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,9 @@ private void cmdValidateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
return;
}
byte[] validatedPdf = null;
for (int i = 0; i < 25; i++) {
for (int i = 0; i < 50; i++) {
try {
ThreadUtils.updateLabel(this.lblProgress, "Warte auf Ergebnis... " + (i + 1) + "/25");
ThreadUtils.updateLabel(this.lblProgress, "Warte auf Ergebnis... " + (i + 1) + "/50");
validatedPdf = locator.lookupVoipServiceRemote().getValidatedLetter(letterId);
this.data.put("pdf.validated.bytes", validatedPdf);
ThreadUtils.updateLabel(this.lblProgress, "Ergebnis wird aufbereitet...");
Expand Down
10 changes: 10 additions & 0 deletions j-lawyer-fax/src/com/jdimension/jlawyer/epost/EpostAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,17 @@ public byte[] getValidatedLetter(String token, int letterId) throws EpostExcepti
if (jsonOutput instanceof JsonObject) {
JsonObject result = (JsonObject) jsonOutput;
JsonKey levelKey = Jsoner.mintJsonKey("data", null);
if(levelKey==null) {
log.warn("Could not retrieve validated letter - missing data attribute");
log.warn(((JsonObject) jsonOutput).toJson());
throw new EpostException("Could not retrieve validated letter - missing data attribute");
}
String base64 = result.getString(levelKey);
if(base64==null) {
log.warn("Could not retrieve validated letter - empty data attribute");
log.warn(((JsonObject) jsonOutput).toJson());
throw new EpostException("Could not retrieve validated letter - empty data attribute");
}
Base64 decoder = new Base64();
bytes = decoder.decode(base64);
}
Expand Down
Binary file modified j-lawyer-server/j-lawyer-server-ejb/lib/j-lawyer-cloud.jar
Binary file not shown.

0 comments on commit 4ad20dc

Please sign in to comment.