1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 23:42:20 +08:00

remove debugerrors

We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
This commit is contained in:
Juan Batiz-Benet
2015-04-20 00:15:34 -07:00
parent b483fdc948
commit 140cd1fd1b
30 changed files with 80 additions and 81 deletions

View File

@ -2,6 +2,7 @@ package fsrepo
import (
"encoding/json"
"errors"
"fmt"
"io"
"os"
@ -10,7 +11,6 @@ import (
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/facebookgo/atomicfile"
"github.com/ipfs/go-ipfs/repo/config"
"github.com/ipfs/go-ipfs/util"
"github.com/ipfs/go-ipfs/util/debugerror"
)
var log = util.Logger("fsrepo")
@ -59,7 +59,7 @@ func encode(w io.Writer, value interface{}) error {
func Load(filename string) (*config.Config, error) {
// if nothing is there, fail. User must run 'ipfs init'
if !util.FileExists(filename) {
return nil, debugerror.New("ipfs not initialized, please run 'ipfs init'")
return nil, errors.New("ipfs not initialized, please run 'ipfs init'")
}
var cfg config.Config