Skip to content

Commit b313774

Browse files
author
Dean Karn
authored
only call helpers on first error (#16)
1 parent 07a3a2e commit b313774

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [5.2.2] - 2022-05-30
10+
### Fixed
11+
- Fixed calling error helpers on first wrap only, where the source of the data will be.
12+
913
## [5.2.1] - 2022-05-30
1014
### Fixed
1115
- Changelog pointing to wrong repo.
@@ -21,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2125
- Updated deps.
2226

2327

24-
[Unreleased]: https://github.com/go-playground/errors/compare/v5.2.1...HEAD
28+
[Unreleased]: https://github.com/go-playground/errors/compare/v5.2.2...HEAD
29+
[5.2.2]: https://github.com/go-playground/errors/compare/v5.2.1...v5.2.2
2530
[5.2.1]: https://github.com/go-playground/errors/compare/v5.2.0...v5.2.1
2631
[5.2.0]: https://github.com/go-playground/errors/compare/v5.1.1...v5.2.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package errors
22
============
3-
![Project status](https://img.shields.io/badge/version-5.2.0-green.svg)
3+
![Project status](https://img.shields.io/badge/version-5.2.2-green.svg)
44
[![Build Status](https://travis-ci.org/go-playground/errors.svg?branch=master)](https://travis-ci.org/go-playground/errors)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/errors)](https://goreportcard.com/report/github.com/go-playground/errors)
66
[![GoDoc](https://godoc.org/github.com/go-playground/errors?status.svg)](https://pkg.go.dev/github.com/go-playground/errors/v5)

errors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ func wrap(err error, prefix string, skipFrames int) (c Chain) {
7575
c = append(c, newLink(err, prefix, skipFrames))
7676
} else {
7777
c = Chain{newLink(err, prefix, skipFrames)}
78-
}
79-
for _, h := range helpers {
80-
if !h(c, err) {
81-
break
78+
for _, h := range helpers {
79+
if !h(c, err) {
80+
break
81+
}
8282
}
8383
}
8484
return

0 commit comments

Comments
 (0)