Skip to content

Commit 7bba800

Browse files
committed
Merge pull request #1098 from ipfs/rm-debugerror
remove debugerrors
2 parents b483fdc + 140cd1f commit 7bba800

File tree

30 files changed

+80
-81
lines changed

30 files changed

+80
-81
lines changed

assets/contact.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package assets
2+
23
var Init_doc_contact = `Come hang out in our IRC chat room if you have any questions.
34
45
Contact the ipfs dev team:

assets/help.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package assets
2+
23
var Init_doc_help = `Some helpful resources for finding your way around ipfs:
34
45
- quick-start: a quick show of various ipfs features.

assets/quick-start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package assets
2+
23
var Init_doc_quick_start = `# 0.1 - Quick Start
34
45
This is a set of short examples with minmal explanation. It is meant as

assets/readme.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package assets
2+
23
var Init_doc_readme = `Hello and Welcome to IPFS!
34
45
██╗██████╗ ███████╗███████╗

assets/security-notes.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package assets
2+
23
var Init_doc_security_notes = ` IPFS Alpha Security Notes
34
45
We try hard to ensure our system is safe and robust, but all software

cmd/ipfs/daemon.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
peer "github.com/ipfs/go-ipfs/p2p/peer"
1515
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
1616
util "github.com/ipfs/go-ipfs/util"
17-
"github.com/ipfs/go-ipfs/util/debugerror"
1817
)
1918

2019
const (
@@ -56,7 +55,7 @@ in the network, use 0.0.0.0 as the ip address:
5655
5756
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
5857
59-
Be careful if you expose the API. It is a security risk, as anyone could use control
58+
Be careful if you expose the API. It is a security risk, as anyone could use control
6059
your node remotely. If you need to control the node remotely, make sure to protect
6160
the port as you would other services or database (firewall, authenticated proxy, etc).`,
6261
},
@@ -98,7 +97,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
9897
if !util.FileExists(req.Context().ConfigRoot) {
9998
err := initWithDefaults(os.Stdout, req.Context().ConfigRoot)
10099
if err != nil {
101-
res.SetError(debugerror.Wrap(err), cmds.ErrNormal)
100+
res.SetError(err, cmds.ErrNormal)
102101
return
103102
}
104103
}
@@ -120,7 +119,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
120119
// sure we are permitted to access the resources (datastore, etc.)
121120
repo, err := fsrepo.Open(req.Context().ConfigRoot)
122121
if err != nil {
123-
res.SetError(debugerror.Errorf("Couldn't obtain lock. Is another daemon already running?"), cmds.ErrNormal)
122+
res.SetError(fmt.Errorf("Couldn't obtain lock. Is another daemon already running?"), cmds.ErrNormal)
124123
return
125124
}
126125

cmd/ipfs/init.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"io"
78

@@ -15,7 +16,6 @@ import (
1516
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
1617
uio "github.com/ipfs/go-ipfs/unixfs/io"
1718
u "github.com/ipfs/go-ipfs/util"
18-
debugerror "github.com/ipfs/go-ipfs/util/debugerror"
1919
)
2020

2121
const nBitsForKeypairDefault = 4096
@@ -65,14 +65,14 @@ var initCmd = &cmds.Command{
6565
},
6666
}
6767

68-
var errRepoExists = debugerror.New(`ipfs configuration file already exists!
68+
var errRepoExists = errors.New(`ipfs configuration file already exists!
6969
Reinitializing would overwrite your keys.
7070
(use -f to force overwrite)
7171
`)
7272

7373
func initWithDefaults(out io.Writer, repoRoot string) error {
7474
err := doInit(out, repoRoot, false, nBitsForKeypairDefault)
75-
return debugerror.Wrap(err)
75+
return err
7676
}
7777

7878
func doInit(out io.Writer, repoRoot string, force bool, nBitsForKeypair int) error {

cmd/ipfs/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
2727
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
2828
u "github.com/ipfs/go-ipfs/util"
29-
"github.com/ipfs/go-ipfs/util/debugerror"
3029
)
3130

3231
// log is the command logger
@@ -355,7 +354,7 @@ func commandDetails(path []string, root *cmds.Command) (*cmdDetails, error) {
355354
var found bool
356355
cmd, found = cmd.Subcommands[cmp]
357356
if !found {
358-
return nil, debugerror.Errorf("subcommand %s should be in root", cmp)
357+
return nil, fmt.Errorf("subcommand %s should be in root", cmp)
359358
}
360359

361360
if cmdDetails, found := cmdDetailsMap[cmd]; found {

core/commands/add.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
dag "github.com/ipfs/go-ipfs/merkledag"
1919
ft "github.com/ipfs/go-ipfs/unixfs"
2020
u "github.com/ipfs/go-ipfs/util"
21-
"github.com/ipfs/go-ipfs/util/debugerror"
2221
)
2322

2423
// Error indicating the max depth has been exceded.
@@ -106,19 +105,19 @@ remains to be implemented.
106105

107106
rootnd, err := addFile(n, file, outChan, progress, wrap)
108107
if err != nil {
109-
res.SetError(debugerror.Wrap(err), cmds.ErrNormal)
108+
res.SetError(err, cmds.ErrNormal)
110109
return
111110
}
112111

113112
err = n.Pinning.Pin(context.Background(), rootnd, true)
114113
if err != nil {
115-
res.SetError(debugerror.Wrap(err), cmds.ErrNormal)
114+
res.SetError(err, cmds.ErrNormal)
116115
return
117116
}
118117

119118
err = n.Pinning.Flush()
120119
if err != nil {
121-
res.SetError(debugerror.Wrap(err), cmds.ErrNormal)
120+
res.SetError(err, cmds.ErrNormal)
122121
return
123122
}
124123
}

core/commands/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package commands
22

33
import (
44
"bytes"
5+
"errors"
56
"io"
67
"sort"
78

@@ -10,7 +11,6 @@ import (
1011
config "github.com/ipfs/go-ipfs/repo/config"
1112
"github.com/ipfs/go-ipfs/repo/fsrepo"
1213
u "github.com/ipfs/go-ipfs/util"
13-
errors "github.com/ipfs/go-ipfs/util/debugerror"
1414
)
1515

1616
type BootstrapOutput struct {

0 commit comments

Comments
 (0)