diff --git a/gateway-service/src/main/java/org/zowe/apiml/gateway/controllers/GatewayExceptionHandler.java b/gateway-service/src/main/java/org/zowe/apiml/gateway/controllers/GatewayExceptionHandler.java index 6eac086a0a..895b8e7fc1 100644 --- a/gateway-service/src/main/java/org/zowe/apiml/gateway/controllers/GatewayExceptionHandler.java +++ b/gateway-service/src/main/java/org/zowe/apiml/gateway/controllers/GatewayExceptionHandler.java @@ -72,8 +72,12 @@ public Mono setBodyResponse(ServerWebExchange exchange, int responseCode, var serverCodecConfigurer = ServerCodecConfigurer.create(); var serverWebExchange = new DefaultServerWebExchange(exchange.getRequest(), exchange.getResponse(), sessionManager, serverCodecConfigurer, localeContextResolver); - serverWebExchange.getResponse().setRawStatusCode(responseCode); - serverWebExchange.getResponse().getHeaders().add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON_VALUE); + try { + serverWebExchange.getResponse().setRawStatusCode(responseCode); + serverWebExchange.getResponse().getHeaders().add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON_VALUE); + } catch (UnsupportedOperationException e) { + log.debug("Cannot update response", e); + } Message message = messageService.createMessage(messageCode, args); try {