Skip to content

Commit

Permalink
Clean up rest code, order of operations
Browse files Browse the repository at this point in the history
This might help with #36
  • Loading branch information
Thomas Goodwin authored and Goodie01 committed Jun 29, 2024
1 parent b71ce44 commit 307aec0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ private <T> HttpResult<T> gettHttpResult(Function<String, T> tSupplier, List<Res
return VerificationUtils.validate(validators, requestSublogger, () -> {
try {
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
T t = tSupplier.apply(resp.body());
HttpResultImpl<T> result = new HttpResultImpl<>(req, resp, t, logger);
log(requestSublogger, req, resp);

return result;
T t = tSupplier.apply(resp.body());

return new HttpResultImpl<>(req, resp, t, logger);
} catch (Exception e) {
throw new MelinoeException(e);
}
Expand Down

0 comments on commit 307aec0

Please sign in to comment.