Skip to content

Commit

Permalink
add: return error from iterator
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
  • Loading branch information
magik6k committed Apr 27, 2019
1 parent 6e5c251 commit 6ffdce8
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 6ffdce8

Please sign in to comment.