Skip to content

Commit

Permalink
Workaround missing isClose() method in older Resteasy JAX-RS Response…
Browse files Browse the repository at this point in the history
… type
  • Loading branch information
thomasdarimont committed Jul 12, 2023
1 parent cdc0f95 commit 49d1020
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public class ResponseUtil {
}

public static String getErrorMessage(WebApplicationException error) {
String errorBody = !error.getResponse().isClosed() ? error.getResponse().readEntity(String.class).trim() : "";
String errorBody = "";
try {
errorBody = error.getResponse().readEntity(String.class).trim();
} catch(Exception ignore) {
// NOOP
}
return error.getMessage() + errorBody;
}
}

0 comments on commit 49d1020

Please sign in to comment.