lib: Wrap errors with errors.Wrap instead of fmt.Errorf (#6181)
This commit is contained in:
committed by
Audrius Butkevicius
parent
e2f6d0d6c4
commit
cf312abc72
@@ -10,7 +10,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"path/filepath"
|
||||
@@ -21,6 +20,9 @@ import (
|
||||
stdsync "sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/thejerf/suture"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/config"
|
||||
"github.com/syncthing/syncthing/lib/connections"
|
||||
"github.com/syncthing/syncthing/lib/db"
|
||||
@@ -35,7 +37,6 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/upgrade"
|
||||
"github.com/syncthing/syncthing/lib/util"
|
||||
"github.com/syncthing/syncthing/lib/versioner"
|
||||
"github.com/thejerf/suture"
|
||||
)
|
||||
|
||||
// How many files to send in each Index/IndexUpdate message.
|
||||
@@ -1799,7 +1800,7 @@ func (m *model) SetIgnores(folder string, content []string) error {
|
||||
err := cfg.CheckPath()
|
||||
if err == config.ErrPathMissing {
|
||||
if err = cfg.CreateRoot(); err != nil {
|
||||
return fmt.Errorf("failed to create folder root: %v", err)
|
||||
return errors.Wrap(err, "failed to create folder root")
|
||||
}
|
||||
err = cfg.CheckPath()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user