Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/main/java/org/prebid/cache/handlers/cache/CacheHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Signal;

import java.util.concurrent.TimeoutException;

Expand Down Expand Up @@ -90,13 +89,12 @@ private Mono<ServerResponse> handleErrorMetrics(final Throwable error, final Ser
}

return builder.error(Mono.just(error), request)
.doOnEach(signal -> handleErrorStatusCodes(request, signal));
.doOnNext(response -> handleErrorStatusCodes(request, response));
}

private void handleErrorStatusCodes(ServerRequest request, Signal<ServerResponse> signal) {
final var response = signal.get();
HttpMethod method = request.method();
if (method == null || signal.isOnError() || response == null) {
private void handleErrorStatusCodes(ServerRequest request, ServerResponse response) {
final HttpMethod method = request.method();
if (method == null || response == null) {
recordMetric(MeasurementTag.ERROR_UNKNOWN);
} else if (response.statusCode() == HttpStatus.INTERNAL_SERVER_ERROR) {
recordMetric(MeasurementTag.ERROR_UNKNOWN);
Expand Down
Loading