Skip to content

Commit 1454985

Browse files
committed
Catch() documentation for logging
1 parent 88baeb7 commit 1454985

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

err2.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ func Handle(err *error, a ...any) {
106106
// behavior with functions like err2.SetErrorTrace, assert.SetDefault, and
107107
// logging settings. Start with the defaults and simplest version of Catch:
108108
//
109-
// defer err2.Catch() // writes errors to logs and panic traces to stderr
109+
// defer err2.Catch()
110110
//
111-
// Catch support logging as well:
111+
// In default the above writes errors to logs and panic traces to stderr.
112+
// Naturally, you can annotate logging:
112113
//
113114
// defer err2.Catch("WARNING: caught errors: %s", name)
114115
//

0 commit comments

Comments
 (0)