Interface LightHttpHandler

    • Method Detail

      • setExchangeStatus

        default void setExchangeStatus​(io.undertow.server.HttpServerExchange exchange,
                                       String code,
                                       Object... args)
        This method is used to construct a standard error status in JSON format from an error code.
        Parameters:
        exchange - HttpServerExchange
        code - error code
        args - arguments for error description
      • setExchangeStatus

        default void setExchangeStatus​(io.undertow.server.HttpServerExchange exchange,
                                       String code,
                                       Map<String,​Object> metadata,
                                       Object... args)
        This method is used to construct a standard error status with metadata in JSON format from an error code.
        Parameters:
        exchange - HttpServerExchange
        code - error code
        metadata - additional metadata info
        args - arguments for error description
      • setExchangeStatus

        default void setExchangeStatus​(io.undertow.server.HttpServerExchange ex,
                                       Status status)
        There are situations that the downstream service returns an error status response and we just want to bubble up to the caller and eventually to the original caller.
        Parameters:
        ex - HttpServerExchange
        status - error status