def handle_error(self, request: Any, status: int = <NUM_LIT>, exc: Any = None, message: Optional[str] = None) -> web.Response:
if self.transport is None:<EOL><INDENT>if self._access_log:<EOL><INDENT>request_ip = RequestHandler.get_request_ip(request, None)<EOL>version_string = None<EOL>if isinstance(request.version, HttpVersion):<EOL><INDENT>version_string = '<STR_LIT>'.format(request.version.major, request.version.minor)<EOL><DEDENT>logging.getLogger('<STR_LIT>').info('<STR_LIT>'.format(<EOL>RequestHandler.colorize_status('<STR_LIT:http>', <NUM_LIT>),<EOL>RequestHandler.colorize_status(<NUM_LIT>),<EOL>request_ip or '<STR_LIT>',<EOL>'<STR_LIT>'.format(request._cache['<STR_LIT>'].login.replace('<STR_LIT:">', '<STR_LIT>')) if request._cache.get('<STR_LIT>') and getattr(request._cache.get('<STR_LIT>'), '<STR_LIT>', None) else '<STR_LIT:->',<EOL>request.method,<EOL>request.path,<EOL>'<STR_LIT>'.format(request.query_string) if request.query_string else '<STR_LIT>',<EOL>'<STR_LIT>'.format(version_string) if version_string else '<STR_LIT>',<EOL>request.content_length if request.content_length is not None else '<STR_LIT:->',<EOL>request.headers.get('<STR_LIT>', '<STR_LIT>').replace('<STR_LIT:">', '<STR_LIT>')<EOL>))<EOL><DEDENT><DEDENT>headers = {}<EOL>headers[hdrs.CONTENT_TYPE] = '<STR_LIT>'<EOL>msg = '<STR_LIT>' if status == <NUM_LIT> or not message else message<EOL>headers[hdrs.CONTENT_LENGTH] = str(len(msg))<EOL>headers[hdrs.SERVER] = self._server_header or '<STR_LIT>'<EOL>resp = web.Response(status=status,  <EOL>text=msg,<EOL>headers=headers)  <EOL>resp.force_close()  <EOL>if request.writer.output_size > <NUM_LIT:0> or self.transport is None:<EOL><INDENT>self.force_close()  <EOL><DEDENT>elif self.transport is not None:<EOL><INDENT>request_ip = RequestHandler.get_request_ip(request, None)<EOL>if not request_ip:<EOL><INDENT>peername = request.transport.get_extra_info('<STR_LIT>')<EOL>if peername:<EOL><INDENT>request_ip, _ = peername<EOL><DEDENT><DEDENT>if self._access_log:<EOL><INDENT>logging.getLogger('<STR_LIT>').info('<STR_LIT>'.format(<EOL>RequestHandler.colorize_status('<STR_LIT:http>', status),<EOL>RequestHandler.colorize_status(status),<EOL>request_ip or '<STR_LIT>',<EOL>'<STR_LIT>'.format(request._cache['<STR_LIT>'].login.replace('<STR_LIT:">', '<STR_LIT>')) if request._cache.get('<STR_LIT>') and getattr(request._cache.get('<STR_LIT>'), '<STR_LIT>', None) else '<STR_LIT:->',<EOL>len(msg)<EOL>))<EOL><DEDENT><DEDENT>return resp<EOL>
Handle errors.

        Returns HTTP response with specific status code. Logs additional
        information. It always closes current connection.