Skip to content

Commit

Permalink
Merge pull request #6272 from ipfs/fix/add/fileerr
Browse files Browse the repository at this point in the history
add: Return error from iterator
  • Loading branch information
Stebalien authored Apr 27, 2019
2 parents fc1832f + 6ffdce8 commit 5e28d48
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/commands/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ You can now check what blocks have been created by:
added++
}

if addit.Err() != nil {
return addit.Err()
}

if added == 0 {
return fmt.Errorf("expected a file argument")
}
Expand Down

0 comments on commit 5e28d48

Please sign in to comment.