mirror of
https://github.com/knadh/listmonk.git
synced 2025-03-01 16:55:26 +08:00
fix: check errors.Is instead of strings.Contains for http: Server closed error (#1779)
This commit is contained in:
parent
860009b866
commit
2afac2469e
1 changed files with 3 additions and 1 deletions
|
@ -4,8 +4,10 @@ import (
|
|||
"bytes"
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
@ -792,7 +794,7 @@ func initHTTPServer(app *App) *echo.Echo {
|
|||
// Start the server.
|
||||
go func() {
|
||||
if err := srv.Start(ko.String("app.address")); err != nil {
|
||||
if strings.Contains(err.Error(), "Server closed") {
|
||||
if errors.Is(err, http.ErrServerClosed) {
|
||||
lo.Println("HTTP server shut down")
|
||||
} else {
|
||||
lo.Fatalf("error starting HTTP server: %v", err)
|
||||
|
|
Loading…
Reference in a new issue