Use default error process

This commit is contained in:
38elements 2016-11-26 16:02:44 +09:00
parent 9010a6573f
commit a5e6d6d2e8

View File

@ -13,7 +13,6 @@ except ImportError:
from .log import log from .log import log
from .request import Request from .request import Request
from .response import HTTPResponse
from .exceptions import RequestTimeout from .exceptions import RequestTimeout
@ -80,12 +79,8 @@ class HttpProtocol(asyncio.Protocol):
self.loop.call_later(time_left, self.connection_timeout) self.loop.call_later(time_left, self.connection_timeout)
else: else:
self._request_handler_task.cancel() self._request_handler_task.cancel()
try:
response = self.error_handler.response( response = self.error_handler.response(
self.request, RequestTimeout('Request Timeout')) self.request, RequestTimeout('Request Timeout'))
except Exception as e:
response = HTTPResponse(
'Request Timeout', RequestTimeout.status_code)
self.write_response(response) self.write_response(response)
# -------------------------------------------- # # -------------------------------------------- #