Skip to content

Commit

Permalink
fix bug loading in case archive response and displaying errors
Browse files Browse the repository at this point in the history
  • Loading branch information
grapigeau committed Oct 24, 2024
1 parent e4cd804 commit bf9988e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ca.on.oicr.gsi.prometheus.LatencyHistogram;
import ca.on.oicr.gsi.shesmu.plugin.*;
import ca.on.oicr.gsi.shesmu.plugin.action.*;
import ca.on.oicr.gsi.shesmu.plugin.json.JsonListBodyHandler;
import ca.on.oicr.gsi.shesmu.plugin.json.JsonBodyHandler;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down Expand Up @@ -198,7 +198,7 @@ public ActionState perform(

try (var timer = NabuRequestTime.start(baseUrl)) {
var response =
HTTP_CLIENT.send(request, new JsonListBodyHandler<>(MAPPER, NabuCaseArchiveDto.class));
HTTP_CLIENT.send(request, new JsonBodyHandler<>(MAPPER, NabuCaseArchiveDto.class));
if (response.statusCode() == 409) {
return ActionState.HALP;
} else if (response.statusCode() / 100 != 2) {
Expand All @@ -208,8 +208,8 @@ public ActionState perform(
} else if (response.statusCode() == 201) {
return ActionState.INFLIGHT;
} else if (response.statusCode() == 200) {
final var results = response.body().get().collect(Collectors.toList());
return actionStatusFromArchive(results.get(0));
final var results = response.body().get();
return actionStatusFromArchive(results);
} else {
return ActionState.UNKNOWN;
}
Expand Down

0 comments on commit bf9988e

Please sign in to comment.