Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
648526d8
Commit
648526d8
authored
9 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make bitswap commands error out properly offline
parent
eff73ccc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
core/commands/bitswap.go
core/commands/bitswap.go
+11
-0
No files found.
core/commands/bitswap.go
View file @
648526d8
...
...
@@ -38,6 +38,12 @@ Print out all blocks currently on the bitswap wantlist for the local peer`,
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
if
!
nd
.
OnlineMode
()
{
res
.
SetError
(
errNotOnline
,
cmds
.
ErrClient
)
return
}
bs
,
ok
:=
nd
.
Exchange
.
(
*
bitswap
.
Bitswap
)
if
!
ok
{
res
.
SetError
(
u
.
ErrCast
(),
cmds
.
ErrNormal
)
...
...
@@ -78,6 +84,11 @@ var bitswapStatCmd = &cmds.Command{
return
}
if
!
nd
.
OnlineMode
()
{
res
.
SetError
(
errNotOnline
,
cmds
.
ErrClient
)
return
}
bs
,
ok
:=
nd
.
Exchange
.
(
*
bitswap
.
Bitswap
)
if
!
ok
{
res
.
SetError
(
u
.
ErrCast
(),
cmds
.
ErrNormal
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment