@cryptotaxi247 / kubo / commits / 6457cc5ab

go-ipfs-config: 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.

Juan Batiz-Benet committed Apr 20, 2015 at 00:15 UTC 6457cc5ab8ec020f24c7b4cc883ebf4254a0124d
4 files changed +9 -9
config/bootstrap_peers.go
+3 -2
@@ -1,7 +1,8 @@
1 package config
2
3 import (
4 - errors "github.com/ipfs/go-ipfs/util/debugerror"
4 + "errors"
5 + "fmt"
6
7 iaddr "github.com/ipfs/go-ipfs/util/ipfsaddr"
8 )
@@ -40,7 +41,7 @@ func (c *Config) BootstrapPeers() ([]BootstrapPeer, error) {
41 func DefaultBootstrapPeers() ([]BootstrapPeer, error) {
42 ps, err := ParseBootstrapPeers(DefaultBootstrapAddresses)
43 if err != nil {
43 - return nil, errors.Errorf(`failed to parse hardcoded bootstrap peers: %s
44 + return nil, fmt.Errorf(`failed to parse hardcoded bootstrap peers: %s
45 This is a problem with the ipfs codebase. Please report it to the dev team.`, err)
46 }
47 return ps, nil
config/gateway.go
+1 -1
@@ -3,5 +3,5 @@ package config
3 // Gateway contains options for the HTTP gateway server.
4 type Gateway struct {
5 RootRedirect string
6 - Writable bool
6 + Writable bool
7 }
config/init.go
+5 -5
@@ -2,12 +2,12 @@ package config
2
3 import (
4 "encoding/base64"
5 + "errors"
6 "fmt"
7 "io"
8
9 ci "github.com/ipfs/go-ipfs/p2p/crypto"
10 peer "github.com/ipfs/go-ipfs/p2p/peer"
10 - errors "github.com/ipfs/go-ipfs/util/debugerror"
11 )
12
13 func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
@@ -44,10 +44,10 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
44 Gateway: "/ip4/127.0.0.1/tcp/8080",
45 },
46
47 - Bootstrap: BootstrapPeerStrings(bootstrapPeers),
48 - SupernodeRouting: *snr,
49 - Datastore: *ds,
50 - Identity: identity,
47 + Bootstrap: BootstrapPeerStrings(bootstrapPeers),
48 + SupernodeRouting: *snr,
49 + Datastore: *ds,
50 + Identity: identity,
51 Log: Log{
52 MaxSizeMB: 250,
53 MaxBackups: 1,
config/log.go
-1
@@ -1,6 +1,5 @@
1 package config
2
3 -
3 type Log struct {
4 MaxSizeMB int
5 MaxBackups int