Skip to content

Commit

Permalink
sample of using multiple error handlers in one err2.Handle
Browse files Browse the repository at this point in the history
  • Loading branch information
lainio committed Feb 16, 2024
1 parent a0180d6 commit c7fec26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion samples/main-play.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ func doDoMain() {
}

func doMain() (err error) {
defer err2.Handle(&err)
// Example of Handle/Catch API where we can have multiple handlers.
defer err2.Handle(&err, err2.Log, err2.Noop, err2.Noop, err2.Log)

// You can select any one of the try.To(CopyFile lines to play with and see
// how err2 works. Especially interesting is automatic stack tracing.
Expand Down

0 comments on commit c7fec26

Please sign in to comment.