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
bee2ba38
Unverified
Commit
bee2ba38
authored
Dec 04, 2017
by
Whyrusleeping
Committed by
GitHub
Dec 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4454 from ipfs/fix/get-error-4452
Fix error handling in commands add and get
parents
39f0f5f7
6f82f086
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
15 deletions
+3
-15
core/commands/add.go
core/commands/add.go
+2
-13
core/commands/get.go
core/commands/get.go
+1
-2
No files found.
core/commands/add.go
View file @
bee2ba38
...
...
@@ -453,19 +453,8 @@ You can now check what blocks have been created by:
for
{
v
,
err
:=
res
.
Next
()
if
err
!=
nil
{
// replace error by actual error - will be looked at by next if-statement
if
err
==
cmds
.
ErrRcvdError
{
err
=
res
.
Error
()
}
if
e
,
ok
:=
err
.
(
*
cmdkit
.
Error
);
ok
{
re
.
Emit
(
e
)
}
else
if
err
!=
io
.
EOF
{
re
.
SetError
(
err
,
cmdkit
.
ErrNormal
)
}
return
if
!
cmds
.
HandleError
(
err
,
res
,
re
)
{
break
}
select
{
...
...
core/commands/get.go
View file @
bee2ba38
...
...
@@ -109,8 +109,7 @@ may also specify the level of compression by specifying '-l=<1-9>'.
defer
re
.
Close
()
v
,
err
:=
res
.
Next
()
if
err
!=
nil
{
log
.
Error
(
e
.
New
(
err
))
if
!
cmds
.
HandleError
(
err
,
res
,
re
)
{
return
}
...
...
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