bugfix: Fixes shutdown functionality (#131)
Fixes an issue where the shutdown functionality did not check for the error type
This commit is contained in:
committed by
GitHub
parent
93fe3e8bd6
commit
c204ebc514
@@ -33,9 +33,13 @@ func startServer(client *Client, projectInfo *ProjectInfo) {
|
||||
go func() {
|
||||
err := server.Serve(l)
|
||||
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)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
port := l.Addr().(*net.TCPAddr).Port
|
||||
|
||||
Reference in New Issue
Block a user