Skip to content

Commit 87422eb

Browse files
committed
Refactor AaregClient and ArbeidsforholdRespons: enhance error handling and add missing imports #deploy-test-dolly-backend
1 parent 9416936 commit 87422eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/dolly-backend/src/main/java/no/nav/dolly/bestilling/aareg/AaregClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ public Flux<ClientFuture> gjenopprett(RsDollyUtvidetBestilling bestilling, Dolly
8181

8282
private Mono<String> getErrors(Throwable error, Set<String> miljoer) {
8383

84+
var decoded = WebClientError.describe(error);
8485
return Mono.just(miljoer.stream()
85-
.map(miljoe -> "%s:Feil= %s".formatted(miljoe, ErrorStatusDecoder.encodeStatus(WebClientError.describe(error).getMessage())))
86+
.map(miljoe -> "%s:Feil= %s".formatted(miljoe, ErrorStatusDecoder.encodeStatus(decoded.getStatus() +
87+
(isBlank(decoded.getMessage()) ? "" : "= %s".formatted(decoded.getMessage())))))
8688
.collect(Collectors.joining(",")));
8789
}
8890

0 commit comments

Comments
 (0)