Source:
<code>public boolean handleRequest(MessageContext messageContext) { logger.debug("Validating the API request Body content.."); org.apache.axis2.context.MessageContext axis2MC = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); String contentType; Object objContentType = axis2MC.getProperty(APIMgtGatewayConstants.REST_CONTENT_TYPE); if (objContentType == null) { return true; } contentType = objContentType.toString(); if (logger.isDebugEnabled()) { logger.debug("Content type of the request message :" + contentType); } try { RelayUtils.buildMessage(axis2MC); logger.debug("Successfully built the request message"); if (!APIMgtGatewayConstants.APPLICATION_JSON.equals(contentType)) { return true; } swagger = messageContext.getProperty(APIMgtGatewayConstants.OPEN_API_STRING).toString(); if (swagger == null) { return true; } ObjectMapper objectMapper = new ObjectMapper(); rootNode = objectMapper.readTree(swagger.getBytes()); requestMethod = messageContext.getProperty(APIMgtGatewayConstants. ELECTED_REQUEST_METHOD).toString(); JSONObject payloadObject = getMessageContent(messageContext); if (!APIConstants.SupportedHTTPVerbs.GET.name().equals(requestMethod) && payloadObject != null && !APIMgtGatewayConstants.EMPTY_ARRAY.equals(payloadObject)) { validateRequest(messageContext); } } catch (IOException | XMLStreamException e) { <START> logger.error("Error occurred while building the API request", e); <END> } catch (APIManagementException e) { logger.error("Error occurred while validating the API request", e); } return true; }</code><technical_language>logging error if is exception validation get ommitted</technical_language>

Target:
public boolean handleRequest(MessageContext messageContext) { logger.debug("Validating the API request Body content.."); org.apache.axis2.context.MessageContext axis2MC = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); String contentType; Object objContentType = axis2MC.getProperty(APIMgtGatewayConstants.REST_CONTENT_TYPE); if (objContentType == null) { return true; } contentType = objContentType.toString(); if (logger.isDebugEnabled()) { logger.debug("Content type of the request message: " + contentType); } try { RelayUtils.buildMessage(axis2MC); logger.debug("Successfully built the request message"); if (!APIMgtGatewayConstants.APPLICATION_JSON.equals(contentType)) { return true; } swagger = messageContext.getProperty(APIMgtGatewayConstants.OPEN_API_STRING).toString(); if (swagger == null) { return true; } ObjectMapper objectMapper = new ObjectMapper(); rootNode = objectMapper.readTree(swagger.getBytes()); requestMethod = messageContext.getProperty(APIMgtGatewayConstants. ELECTED_REQUEST_METHOD).toString(); JSONObject payloadObject = getMessageContent(messageContext); if (!APIConstants.SupportedHTTPVerbs.GET.name().equals(requestMethod) && payloadObject != null && !APIMgtGatewayConstants.EMPTY_ARRAY.equals(payloadObject)) { validateRequest(messageContext); } } catch (IOException | XMLStreamException e) { logger.error("Error occurred while building the API request", e); return false; } catch (APIManagementException e) { logger.error("Error occurred while validating the API request", e); return false; } return true; }