From c830e643098c01556d1ad4bb1a6371b2b01bd278 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Tue, 19 Mar 2019 01:13:30 +0100 Subject: [PATCH] fix: gracefully handling https.server starting errors --- modules/https_server/https_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/https_server/https_server.go b/modules/https_server/https_server.go index 0ed5e96a..ae26c009 100644 --- a/modules/https_server/https_server.go +++ b/modules/https_server/https_server.go @@ -159,7 +159,8 @@ func (mod *HttpsServer) Start() error { return mod.SetRunning(true, func() { mod.Info("starting on https://%s", mod.server.Addr) if err := mod.server.ListenAndServeTLS(mod.certFile, mod.keyFile); err != nil && err != http.ErrServerClosed { - panic(err) + mod.Error("%v", err) + mod.Stop() } }) }