From d771ddb3d3daf51ea4d4f1a6f32fe6ce8aa26a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sat, 27 Jan 2024 16:25:17 -0800 Subject: [PATCH] actually handle any http server errors --- cmd/web/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/web/main.go b/cmd/web/main.go index 6f7a77f..88fce17 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -29,6 +29,9 @@ func main() { } // and finally, start the server - app.Logger.Printf("Listening on port %d", app.ListenPort) - srv.ListenAndServe() + app.Logger.Printf("Starting HTTP Server on port %d", app.ListenPort) + err := srv.ListenAndServe() + if err != nil { + app.Logger.Fatal("Failed to start HTTP Server!", "err", err) + } }