Skip to content

WebClient onStatus order changed #23880

Closed
@trecloux

Description

@trecloux

Affects: 5.2.0

Hi all,

It looks like the onStatus custom error predicates are now evaluated in the inverted order compared to version 5.1.x

Using the WebClient this way:

webClient.
// ...
  .onStatus(
     HttpStatus.BAD_REQUEST::equals,
     res -> res.bodyToMono(Void.class).then(Mono.just(new SpecificException()))
  )
  .onStatus(
    HttpStatus::isError,
    res -> res.bodyToMono(Void.class).then(Mono.just(new GenericException())))
   )

// ...

Using 5.1.0 first onStatus was evaluated first, using version 5.2.0 with the same WebClient usage, last onStatus is evaluated first and behavior is significantly changed.

This behavior change was introduced in commit a9b3d95

If this onStatus evaluation order is not guaranteed, I think that this should be documented.

I can submit a documentation or a fix pull request.

Thomas

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions