private void respondErrorAndClose(HttpExchange exchange, ErrorResponse errorResponse) throws IOException { respondWithXmlDocumentAndClose( exchange, errorResponse.getStatusCode(), new ErrorResponseXmlDocument(errorResponse)); }