Interface ErrorExchangeHandler<A extends Throwable,B extends ErrorExchange<A>>

Type Parameters:
A - the error type
B - the error exchange type handled by the handler
All Superinterfaces:
ReactiveExchangeHandler<ExchangeContext,B>

public interface ErrorExchangeHandler<A extends Throwable,B extends ErrorExchange<A>> extends ReactiveExchangeHandler<ExchangeContext,B>

Exchange handler used to handle error server exchanges.

The HTTP server relies on an error exchange handler to handle errors thrown during the processing of a client request in order to provide a proper response to the client.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • defer

      default reactor.core.publisher.Mono<Void> defer(B exchange)

      Returns a Mono that defers the execution of handle(io.inverno.mod.http.server.ErrorExchange).

      Specified by:
      defer in interface ReactiveExchangeHandler<A extends Throwable,B extends ErrorExchange<A>>
      Parameters:
      exchange - the exchange to process
      Returns:
      an empty mono that completes when the exchange has been processed
    • handle

      void handle(B exchange) throws HttpException

      Processes the specified server exchange.

      The purpose of this method is to eventually inject a ResponseBody in the response which basically completes the exchange

      Parameters:
      exchange - the exchange to process
      Throws:
      HttpException - if an error occurs during the processing of the exchange