Interface ErrorHttpMapper<E>

Type Parameters:
E - the domain error type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@NullMarked @FunctionalInterface public interface ErrorHttpMapper<E>
Maps a domain error of type E to an HTTP ServerResponse.

Supplied to WebfluxFun.fromResult(Mono, ErrorHttpMapper) and WebfluxFun.fromResultStream(Flux, ErrorHttpMapper) so a Result.Err is rendered with a status and body the application controls.

  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse>
    apply(E error)
    Renders the given error as an HTTP response.
  • Method Details

    • apply

      reactor.core.publisher.Mono<org.springframework.web.reactive.function.server.ServerResponse> apply(E error)
      Renders the given error as an HTTP response.
      Parameters:
      error - the domain error
      Returns:
      the response to send for this error