1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-18 06:18:08 +00:00

Fix ClientDisconnectedError

Fix #124
This commit is contained in:
Julien Duponchelle 2015-03-31 22:05:50 +02:00
parent 93344e9427
commit 220d585dcc

View File

@ -123,7 +123,7 @@ class Route(object):
yield from func(request, response) yield from func(request, response)
return response return response
# API call # API call
try: try:
request = yield from parse_request(request, input_schema) request = yield from parse_request(request, input_schema)
server_config = Config.instance().get_section_config("Server") server_config = Config.instance().get_section_config("Server")
@ -151,6 +151,11 @@ class Route(object):
response = Response(route=route) response = Response(route=route)
response.set_status(408) response.set_status(408)
response.json({"message": "Request canceled", "status": 408}) response.json({"message": "Request canceled", "status": 408})
except aiohttp.ClientDisconnectedError:
log.error("Client disconnected")
response = Response(route=route)
response.set_status(408)
response.json({"message": "Client disconnected", "status": 408})
except Exception as e: except Exception as e:
log.error("Uncaught exception detected: {type}".format(type=type(e)), exc_info=1) log.error("Uncaught exception detected: {type}".format(type=type(e)), exc_info=1)
response = Response(route=route) response = Response(route=route)