mirror of
https://github.com/rclone/rclone.git
synced 2025-08-23 11:32:03 +02:00
serve http, webdav, restic: ensure rclone exits if the port is in use
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
auth "github.com/abbot/go-http-auth"
|
||||
"github.com/ncw/rclone/fs"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Globals
|
||||
@@ -188,7 +189,7 @@ func NewServer(handler http.Handler, opt *Options) *Server {
|
||||
func (s *Server) Serve() error {
|
||||
ln, err := net.Listen("tcp", s.httpServer.Addr)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrapf(err, "start server failed")
|
||||
}
|
||||
s.listener = ln
|
||||
s.waitChan = make(chan struct{})
|
||||
|
Reference in New Issue
Block a user