Skip to content

Commit

Permalink
only call helpers on first error (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
deankarn committed May 31, 2022
1 parent 07a3a2e commit b313774
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.2.2] - 2022-05-30
### Fixed
- Fixed calling error helpers on first wrap only, where the source of the data will be.

## [5.2.1] - 2022-05-30
### Fixed
- Changelog pointing to wrong repo.
Expand All @@ -21,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated deps.


[Unreleased]: https://github.com/go-playground/errors/compare/v5.2.1...HEAD
[Unreleased]: https://github.com/go-playground/errors/compare/v5.2.2...HEAD
[5.2.2]: https://github.com/go-playground/errors/compare/v5.2.1...v5.2.2
[5.2.1]: https://github.com/go-playground/errors/compare/v5.2.0...v5.2.1
[5.2.0]: https://github.com/go-playground/errors/compare/v5.1.1...v5.2.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package errors
============
![Project status](https://img.shields.io/badge/version-5.2.0-green.svg)
![Project status](https://img.shields.io/badge/version-5.2.2-green.svg)
[![Build Status](https://travis-ci.org/go-playground/errors.svg?branch=master)](https://travis-ci.org/go-playground/errors)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/errors)](https://goreportcard.com/report/github.com/go-playground/errors)
[![GoDoc](https://godoc.org/github.com/go-playground/errors?status.svg)](https://pkg.go.dev/github.com/go-playground/errors/v5)
Expand Down
8 changes: 4 additions & 4 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ func wrap(err error, prefix string, skipFrames int) (c Chain) {
c = append(c, newLink(err, prefix, skipFrames))
} else {
c = Chain{newLink(err, prefix, skipFrames)}
}
for _, h := range helpers {
if !h(c, err) {
break
for _, h := range helpers {
if !h(c, err) {
break
}
}
}
return
Expand Down

0 comments on commit b313774

Please sign in to comment.