improve httpServer error handling

This commit is contained in:
Amolith 2023-09-26 15:32:07 -04:00
parent 1750d9e0e0
commit 61f56f5e80
Signed by: Amolith
GPG Key ID: 8AE30347CE28D101
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ package main
import (
"encoding/csv"
"errors"
"fmt"
"log"
"net/http"
@ -92,7 +93,7 @@ func main() {
mux.HandleFunc("/static", staticHandler)
mux.HandleFunc("/new", newHandler)
if err := httpServer.ListenAndServe(); err == http.ErrServerClosed {
if err := httpServer.ListenAndServe(); errors.Is(err, http.ErrServerClosed) {
log.Println("Web server closed")
} else {
log.Fatalln(err)