From 8b13e103fd23374886d8adb2a0c62f6cbfa35c99 Mon Sep 17 00:00:00 2001 From: Nicolas Delaby Date: Fri, 28 Apr 2017 19:08:51 +0200 Subject: [PATCH] In case of error when starting sanic Don't exit with code 0 --- sanic/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/app.py b/sanic/app.py index c0505ab0..f6f54b38 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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")