File tree Expand file tree Collapse file tree 4 files changed +26
-12
lines changed
Expand file tree Collapse file tree 4 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
77
88
9- ## [ Unreleased] ( https://github.com/gravitton/errors/compare/v0.1 .0...master )
9+ ## [ Unreleased] ( https://github.com/gravitton/errors/compare/v1.0 .0...master )
1010
1111
12- ## v0.1 .0 (2025-08-03 )
12+ ## v1.0 .0 (2025-10-17 )
1313### Added
14+ - ` DataError ` with additional context fields and cause error
15+ - ` MultiError ` concurrent safe multi error
Original file line number Diff line number Diff line change @@ -21,6 +21,23 @@ go get github.com/gravitton/errors
2121
2222## Usage
2323
24+
25+ ``` go
26+ package main
27+
28+ import (
29+ " github.com/gravitton/errors"
30+ )
31+
32+ func Process () error {
33+ if err := subProcess (); err != nil {
34+ return errors.Wrap (err).WithField (" process" , " abc" ).WithCause (err)
35+ }
36+
37+ return errors.Newf (" this should not happen %s " , " again" )
38+ }
39+ ```
40+
2441``` go
2542package main
2643
@@ -32,13 +49,8 @@ import (
3249func Process () error {
3350 errs := errors.NewMulti ()
3451
35- if err := process1 (); err != nil {
36- errs.Append (err)
37- }
38-
39- if err := process2 (); err != nil {
40- errs.Append (err)
41- }
52+ errs.Append (process (1 ))
53+ errs.Append (process (2 ))
4254
4355 return errs.ErrorOrNil ()
4456}
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module github.com/gravitton/errors
22
33go 1.25
44
5- require github.com/gravitton/assert v0.5 .0
5+ require github.com/gravitton/assert v1.0 .0
Original file line number Diff line number Diff line change 1- github.com/gravitton/assert v0.5 .0 h1:7HW4+nagmtDEI7ZMBjeZo/sBJTNnxtWGoVw/Vxe1VUU =
2- github.com/gravitton/assert v0.5 .0/go.mod h1:wQGHJvwsxQQ7qdX++NLofrI2cJvYIdJJtAo7A15qcAY =
1+ github.com/gravitton/assert v1.0 .0 h1:VhxPuIN6KNpDXIdMtoKa0tGB/bkxZ0h1mm6jTzBkhnc =
2+ github.com/gravitton/assert v1.0 .0/go.mod h1:wQGHJvwsxQQ7qdX++NLofrI2cJvYIdJJtAo7A15qcAY =
You can’t perform that action at this time.
0 commit comments