Code snippet optimization
This commit is contained in:
@@ -79,7 +79,7 @@ public class FizzApiDispatchHttpHandler implements HttpHandler {
|
||||
request = forwardedHeaderTransformer.apply(request);
|
||||
} catch (Throwable t) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Failed to apply forwarded headers to " + formatRequest(request), t);
|
||||
log.debug("Failed to apply forwarded headers to {}", formatRequest(request), t);
|
||||
}
|
||||
response.setStatusCode(HttpStatus.BAD_REQUEST);
|
||||
return response.setComplete();
|
||||
@@ -93,7 +93,7 @@ public class FizzApiDispatchHttpHandler implements HttpHandler {
|
||||
log.info("client request path: {}", clientReqPath);
|
||||
Mono<MultiValueMap<String, String>> formData = exchange.getFormData().defaultIfEmpty(FizzServerWebExchangeDecorator.EMPTY_FORM_DATA).flatMap(
|
||||
dat -> {
|
||||
log.info("form data: " + JacksonUtils.writeValueAsString(dat));
|
||||
log.info("form data: {}", JacksonUtils.writeValueAsString(dat));
|
||||
return Mono.just(dat);
|
||||
}
|
||||
);
|
||||
@@ -108,8 +108,10 @@ public class FizzApiDispatchHttpHandler implements HttpHandler {
|
||||
.onErrorResume( t -> handleUnresolvedError(exchange, t) )
|
||||
.then ( Mono.defer(response::setComplete) );
|
||||
} catch (Throwable t) {
|
||||
throw t;
|
||||
// TODO: response error
|
||||
// throw t;
|
||||
log.error(exchange.getLogPrefix() + " 500 Server Error for " + formatRequest(request), t);
|
||||
response.setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return response.setComplete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user