fix: gracefully handling http.server starting errors

This commit is contained in:
evilsocket 2019-03-19 01:12:36 +01:00
commit 51667a039f
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -110,7 +110,8 @@ func (mod *HttpServer) Start() error {
var err error
mod.Info("starting on http://%s", mod.server.Addr)
if err = mod.server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
panic(err)
mod.Error("%v", err)
mod.Stop()
}
})
}