bugfix: Fixes shutdown functionality (#131)

Fixes an issue where the shutdown functionality did not check for the error type
This commit is contained in:
Harrison (Harry) Cramer
2023-12-04 10:24:51 -05:00
committed by GitHub
parent 93fe3e8bd6
commit c204ebc514

View File

@@ -33,9 +33,13 @@ func startServer(client *Client, projectInfo *ProjectInfo) {
go func() { go func() {
err := server.Serve(l) err := server.Serve(l)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "Error starting server: %s\n", err) if errors.Is(err, http.ErrServerClosed) {
os.Exit(0)
} else {
fmt.Fprintf(os.Stderr, "Server did not respond: %s\n", err)
os.Exit(1) os.Exit(1)
} }
}
}() }()
port := l.Addr().(*net.TCPAddr).Port port := l.Addr().(*net.TCPAddr).Port