Skip to content

Commit c7fec26

Browse files
committed
sample of using multiple error handlers in one err2.Handle
1 parent a0180d6 commit c7fec26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/main-play.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ func doDoMain() {
144144
}
145145

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

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

0 commit comments

Comments
 (0)