From c7fec262ea2dcc5fb180e3edbab63fe842f3fae7 Mon Sep 17 00:00:00 2001 From: Harri Lainio Date: Fri, 16 Feb 2024 17:24:42 +0200 Subject: [PATCH] sample of using multiple error handlers in one err2.Handle --- samples/main-play.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/main-play.go b/samples/main-play.go index 4788bbe..16e19c7 100644 --- a/samples/main-play.go +++ b/samples/main-play.go @@ -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.