Example usage for org.springframework.web.reactive.function.server ServerRequest exchange

List of usage examples for org.springframework.web.reactive.function.server ServerRequest exchange

Introduction

In this page you can find the example usage for org.springframework.web.reactive.function.server ServerRequest exchange.

Prototype

ServerWebExchange exchange();

Source Link

Document

Get the web exchange that this request is based on.

Usage

From source file:org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler.java

private void logError(ServerRequest request, ServerResponse response, Throwable throwable) {
    if (logger.isDebugEnabled()) {
        logger.debug(request.exchange().getLogPrefix() + formatError(throwable, request));
    }/*from w  w  w  . j  a v  a 2 s . c o m*/
    if (response.statusCode().equals(HttpStatus.INTERNAL_SERVER_ERROR)) {
        logger.error(request.exchange().getLogPrefix() + "500 Server Error for " + formatRequest(request),
                throwable);
    }
}

From source file:org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler.java

/**
 * Log the original exception if handling it results in a Server Error or a Bad
 * Request (Client Error with 400 status code) one.
 * @param request the source request//from   ww  w. j a  v a  2s  .c o m
 * @param errorStatus the HTTP error status
 */
protected void logError(ServerRequest request, HttpStatus errorStatus) {
    Throwable ex = getError(request);
    if (logger.isDebugEnabled()) {
        logger.debug(request.exchange().getLogPrefix() + formatError(ex, request));
    }
}