File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -63,16 +63,18 @@ var (
63
63
// an second argument:
64
64
//
65
65
// defer err2.Handle(&err, func(err error) error {
66
- // os.Remove(dst)
66
+ // if rmErr := os.Remove(dst); rmErr != nil {
67
+ // return fmt.Errorf("%w: cleanup error: %w", err, rmErr)
68
+ // }
67
69
// return err
68
70
// })
69
71
//
70
72
// If you need to stop general panics in handler, you can do that by giving a
71
73
// panic handler function:
72
74
//
73
75
// defer err2.Handle(&err,
74
- // err2.Err( func(error) { os.Remove(dst) }), // err2.Err keeps it short
75
- // func(p any) {} // panic handler, it's stops panics, you can re-throw
76
+ // err2.Err( func(error) { os.Remove(dst) }), // err2.Err() keeps it short
77
+ // func(p any) {} // <- handler stops panics, re-throw or not
76
78
// )
77
79
func Handle (err * error , a ... any ) {
78
80
// This and others are similar but we need to call `recover` here because
You can’t perform that action at this time.
0 commit comments