mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-02 11:58:28 +00:00
Improve no such node error messages
This commit is contained in:
parent
af3e64a5a7
commit
2f660aff7a
7
model.go
7
model.go
@ -12,7 +12,6 @@ acquire locks, but document what locks they require.
|
||||
*/
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
@ -40,10 +39,6 @@ type Model struct {
|
||||
lastIdxBcastRequest time.Time
|
||||
}
|
||||
|
||||
var (
|
||||
errNoSuchNode = errors.New("no such node")
|
||||
)
|
||||
|
||||
const (
|
||||
FlagDeleted = 1 << 12
|
||||
|
||||
@ -231,7 +226,7 @@ func (m *Model) RequestGlobal(nodeID, name string, offset uint64, size uint32, h
|
||||
nc, ok := m.nodes[nodeID]
|
||||
m.RUnlock()
|
||||
if !ok {
|
||||
return nil, errNoSuchNode
|
||||
return nil, fmt.Errorf("RequestGlobal: no such node: %s", nodeID)
|
||||
}
|
||||
|
||||
if opts.Debug.TraceNet {
|
||||
|
@ -34,7 +34,7 @@ func (m *Model) pullFile(name string) error {
|
||||
m.RUnlock()
|
||||
|
||||
if len(nodeIDs) == 0 {
|
||||
return errNoSuchNode
|
||||
return fmt.Errorf("%s: no connected nodes with file available", name)
|
||||
}
|
||||
|
||||
filename := path.Join(m.dir, name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user