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.
This commit is contained in:
Juan Batiz-Benet 2015-04-20 00:15:34 -07:00
parent 154216d34d
commit 6457cc5ab8
4 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,8 @@
package config
import (
errors "github.com/ipfs/go-ipfs/util/debugerror"
"errors"
"fmt"
iaddr "github.com/ipfs/go-ipfs/util/ipfsaddr"
)
@ -40,7 +41,7 @@ func (c *Config) BootstrapPeers() ([]BootstrapPeer, error) {
func DefaultBootstrapPeers() ([]BootstrapPeer, error) {
ps, err := ParseBootstrapPeers(DefaultBootstrapAddresses)
if err != nil {
return nil, errors.Errorf(`failed to parse hardcoded bootstrap peers: %s
return nil, fmt.Errorf(`failed to parse hardcoded bootstrap peers: %s
This is a problem with the ipfs codebase. Please report it to the dev team.`, err)
}
return ps, nil

View File

@ -3,5 +3,5 @@ package config
// Gateway contains options for the HTTP gateway server.
type Gateway struct {
RootRedirect string
Writable bool
Writable bool
}

View File

@ -2,12 +2,12 @@ package config
import (
"encoding/base64"
"errors"
"fmt"
"io"
ci "github.com/ipfs/go-ipfs/p2p/crypto"
peer "github.com/ipfs/go-ipfs/p2p/peer"
errors "github.com/ipfs/go-ipfs/util/debugerror"
)
func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
@ -44,10 +44,10 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) {
Gateway: "/ip4/127.0.0.1/tcp/8080",
},
Bootstrap: BootstrapPeerStrings(bootstrapPeers),
SupernodeRouting: *snr,
Datastore: *ds,
Identity: identity,
Bootstrap: BootstrapPeerStrings(bootstrapPeers),
SupernodeRouting: *snr,
Datastore: *ds,
Identity: identity,
Log: Log{
MaxSizeMB: 250,
MaxBackups: 1,

View File

@ -1,6 +1,5 @@
package config
type Log struct {
MaxSizeMB int
MaxBackups int