Optimize uses of onErrorResume()

This commit replaces uses of onErrorResume() with
- onErrorMap() in places where onErrorResume() is just used to map to a
  different exception.
- onErrorComplete() where onErrorResume() just maps to Mono.empty().
- onErrorReturn() where onErrorResum() just maps to Mono.just().

Closes gh-31352
This commit is contained in:
Kai Zander
2023-10-03 13:23:56 +02:00
committed by Brian Clozel
parent 14c5228288
commit e8b42c5439
13 changed files with 23 additions and 23 deletions

View File

@@ -105,7 +105,7 @@ class ServerHttpResponseTests {
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set(HttpHeaders.CONTENT_ENCODING, "gzip");
headers.setContentLength(12);
response.writeWith(body).onErrorResume(ex -> Mono.empty()).block();
response.writeWith(body).onErrorComplete().block();
assertThat(response.statusCodeWritten).isFalse();
assertThat(response.headersWritten).isFalse();