Skip to content

Commit

Permalink
bump to v3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed Aug 8, 2023
1 parent d763511 commit b3e4f71
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

- v3.1.6
- improved/fixed the formatting algorithm on error object
- added more builtin error codes, such as IllegalState
- improved godoc
- added TestCodeRegister
- added integral value as suffix of Code error formatted output.

- v3.1.5
- fixed `errors.New("").Attach(errs...)` don't skip the `empty` error.
**Attach ignores an error only if it is nil**.
Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Wrapped errors and more for golang developing (not just for go1.11, go1.13, and

## History

- v3.1.6
- improved/fixed the formatting algorithm on error object
- added more builtin error codes, such as IllegalState
- improved godoc
- added TestCodeRegister
- added integral value as suffix of Code error formatted output.

- v3.1.5
- fixed `errors.New("").Attach(errs...)` don't skip the `empty` error.
**Attach ignores an error only if it is nil**.
Expand All @@ -49,7 +56,7 @@ Wrapped errors and more for golang developing (not just for go1.11, go1.13, and
- added `Join()` to compliant with go1.20 errors.Join
- reviewed all of testcases

- v3.0.21 ..
- v3.0.21
- add: `RegisterCode()` at top level for initialize user-defined Coded decl
- godoc and fix/imp Attach() to copy inner errors' StackTrace
- fix Is(): Is(err, errors.BadRequest) might be dead lock or cannot return the test result probably
Expand Down Expand Up @@ -81,6 +88,23 @@ These features are supported for compatibilities.
- in an error by `Wrap()`, stacktrace wrapped;
- for your error, attached by `WithStack(cause error)`;

#### Some Enhancements

- `AsSlice(errs []error, target interface{}) bool`
- `IsAnyOf(err error, targets ...error) bool`
- `IsSlice(errs []error, target error) bool`
- `TypeIs(err, target error) bool`
- `TypeIsSlice(errs []error, target error) bool`
- `Join(errs ...error) error`
- `DumpStacksAsString(allRoutines bool) string`
- `CanAttach(err interface{}) (ok bool)`
- `CanCause(err interface{}) (ok bool)`
- `CanCauses(err interface{}) (ok bool)`
- `CanUnwrap(err interface{}) (ok bool)`
- `CanIs(err interface{}) (ok bool)`
- `CanAs(err interface{}) (ok bool)`
- `Causes(err error) (errs []error)`

## Best Practices

### Basics
Expand Down
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const (
// AppName const
AppName = "errors"
// Version const
Version = "3.1.5"
Version = "3.1.6"
// VersionInt const
VersionInt = 0x030105
VersionInt = 0x030106
)

0 comments on commit b3e4f71

Please sign in to comment.