@@ -148,19 +148,23 @@ func doMain() (err error) {
148
148
// Note that this is a silly sample where logging is done trice and noops
149
149
// are used without a purpose. All of this is that you get an idea how you
150
150
// could use the error handlers and chain them together.
151
- defer err2 .Handle (& err , err2 .Log , err2 .Noop , err2 .Noop , err2 .Log )
151
+
152
+ //defer err2.Handle(&err, err2.Noop, err2.Log, err2.Log)
153
+ //defer err2.Handle(&err, nil, err2.Noop, err2.Log)
154
+ //defer err2.Handle(&err, nil, err2.Log)
155
+ defer err2 .Handle (& err )
152
156
153
157
// You can select any one of the try.To(CopyFile lines to play with and see
154
158
// how err2 works. Especially interesting is automatic stack tracing.
155
159
//
156
160
// source file exists, but the destination is not in high probability
157
- try .To (CopyFile ("main.go" , "/notfound/path/file.bak" ))
161
+ // try.To(OrgCopyFile ("main.go", "/notfound/path/file.bak"))
158
162
159
163
// Both source and destination don't exist
160
- //try.To(CopyFile ("/notfound/path/file.go", "/notfound/path/file.bak"))
164
+ //try.To(OrgCopyFile ("/notfound/path/file.go", "/notfound/path/file.bak"))
161
165
162
166
// 2nd argument is empty
163
- // try.To(CopyFile ("main.go", ""))
167
+ try .To (OrgCopyFile ("main.go" , "" ))
164
168
165
169
// Next fn demonstrates how error and panic traces work, comment out all
166
170
// above CopyFile calls to play with:
0 commit comments