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) serve(**server_settings)
else: else:
serve_multiple(server_settings, workers) serve_multiple(server_settings, workers)
except: except Exception:
log.exception( log.exception(
'Experienced exception while trying to serve') 'Experienced exception while trying to serve')
raise
finally: finally:
self.is_running = False self.is_running = False
log.info("Server Stopped") log.info("Server Stopped")