We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfde0a4 commit 097ce05Copy full SHA for 097ce05
handlers.go
@@ -16,6 +16,9 @@ import (
16
// func main() {
17
// defer err2.Catch(err2.Stderr)
18
func Stderr(err error) error {
19
+ if err == nil {
20
+ return nil
21
+ }
22
fmt.Fprintln(os.Stderr, err.Error())
23
return nil
24
}
@@ -29,6 +32,9 @@ func Stderr(err error) error {
29
32
30
33
// defer err2.Catch(err2.Stdout)
31
34
func Stdout(err error) error {
35
36
37
38
fmt.Fprintln(os.Stdout, err.Error())
39
40
@@ -69,6 +75,9 @@ const lvl = 10
69
75
70
76
// Log prints error string to the current log that is set by SetLogTracer.
71
77
func Log(err error) error {
78
79
80
72
81
_ = handler.LogOutput(lvl, err.Error())
73
82
return err
74
83
0 commit comments