Skip to content

Commit a7a9a13

Browse files
committed
use org file copy and more samples
1 parent ad70547 commit a7a9a13

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

samples/main-play.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,23 @@ func doMain() (err error) {
148148
// Note that this is a silly sample where logging is done trice and noops
149149
// are used without a purpose. All of this is that you get an idea how you
150150
// 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)
152156

153157
// You can select any one of the try.To(CopyFile lines to play with and see
154158
// how err2 works. Especially interesting is automatic stack tracing.
155159
//
156160
// 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"))
158162

159163
// 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"))
161165

162166
// 2nd argument is empty
163-
//try.To(CopyFile("main.go", ""))
167+
try.To(OrgCopyFile("main.go", ""))
164168

165169
// Next fn demonstrates how error and panic traces work, comment out all
166170
// above CopyFile calls to play with:

0 commit comments

Comments
 (0)