@Test public void handleErrorWithFallback() { Flux<String> flux = Flux.just("31", "12", "2", "A", "5", "6"); Flux<Integer> numbers = workshop.handleErrorWithFallback(flux); StepVerifier.create(numbers).expectNext(31, 12, 2, 0).expectComplete().verify(); }
public Flux<Integer> handleErrorWithFallback(Flux<String> numbers) { return numbers.map(s -> Integer.parseInt(s)) .onErrorReturn(NumberFormatException.class, 0) .log(); }
Part04HandlingErrors { public Flux<Integer> handleErrorWithFallback(Flux<String> numbers) { return numbers.map(s -> Integer.parseInt(s)) .onErrorReturn(NumberFormatException.class, 0) .log(); } }
Part04HandlingErrors { public Flux<Integer> handleErrorWithFallback(Flux<String> numbers) { return numbers.map(s -> Integer.parseInt(s)) .onErrorReturn(NumberFormatException.class, 0) .log(); }  }
Part04HandlingErrors { public Flux<Integer> handleErrorWithFallback(Flux<String> numbers) { return numbers.map(s -> Integer.parseInt(s)) .onErrorReturn(NumberFormatException.class, 0) .log(); }  Flux<Integer> errorIsTerminal(Flux<String> numbers); Flux<Integer> handleErrorWithFallback(Flux<String> numbers); Flux<Integer> handleErrorAndContinue(Flux<String> numbers); Flux<Integer> handleErrorWithEmptyMonoAndContinue(Flux<String> numbers); Flux<String> timeOutWithRetry(Flux<String> colors); Mono<String> simulateRemoteCall(String input); }
Part04HandlingErrors { public Flux<Integer> handleErrorWithFallback(Flux<String> numbers) { return numbers.map(s -> Integer.parseInt(s)) .onErrorReturn(NumberFormatException.class, 0) .log(); }  Flux<Integer> errorIsTerminal(Flux<String> numbers); Flux<Integer> handleErrorWithFallback(Flux<String> numbers); Flux<Integer> handleErrorAndContinue(Flux<String> numbers); Flux<Integer> handleErrorWithEmptyMonoAndContinue(Flux<String> numbers); Flux<String> timeOutWithRetry(Flux<String> colors); Mono<String> simulateRemoteCall(String input);  }