Skip to content

Commit

Permalink
fix error handling example in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kamstrup committed Jun 2, 2023
1 parent 167ad87 commit f5b779f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/error.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func downloadFile(name string) error {
}

func downloadAllFiles() error {
firstErr, _ := seq.MappingOf(filesToDownload.Seq(), downloadFile).First(1)
return firstErr.Or(nil)
firstErr, _ := seq.MappingOf(filesToDownload.Seq(), downloadFile).
Where(seq.IsNonZero[error]).
First()
return firstErr.Or(nil)
}
```

0 comments on commit f5b779f

Please sign in to comment.