In case of error when starting sanic

Don't exit with code 0
This commit is contained in:
Nicolas Delaby 2017-04-28 19:08:51 +02:00
parent 5f94f65f4f
commit 8b13e103fd

View File

@ -570,9 +570,10 @@ class Sanic:
serve(**server_settings)
else:
serve_multiple(server_settings, workers)
except:
except Exception:
log.exception(
'Experienced exception while trying to serve')
raise
finally:
self.is_running = False
log.info("Server Stopped")