From 24918bf1e2383f63ebb8bdfb15f26613db12af86 Mon Sep 17 00:00:00 2001 From: Hamza Ali Date: Thu, 26 Sep 2019 07:42:13 +0700 Subject: [PATCH] code: log error if http server does not go online --- code/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/main.go b/code/main.go index 96822e2..11f0d2f 100644 --- a/code/main.go +++ b/code/main.go @@ -39,5 +39,8 @@ func main() { http.HandleFunc("/websocket", websocketConnection) http.Handle("/", http.FileServer(http.Dir("./static"))) - http.ListenAndServe(":8080", nil) + err := http.ListenAndServe(":8080", nil) + if err != nil { + fmt.Errorf("Server could not start up: %s", err.Error()) + } }