@@ -7,7 +7,7 @@ An error implementation with StatusCode and Stacktrace
77## Install
88
99``` console
10- $ go get github.com/tools/godep
10+ $ go get github.com/efimovalex/stackerr
1111```
1212
1313## Usage
@@ -16,6 +16,7 @@ $ go get github.com/tools/godep
1616package main
1717
1818import " github.com/efimovalex/stackerr"
19+ import " fmt"
1920
2021func f1 () *stackerr .Err {
2122 err := stackerr.Error (" message" )
@@ -38,17 +39,29 @@ func main() {
3839 ts := t1{}
3940 err := ts.f3 ()
4041
42+ fmt.Println (err.Sprint ())
43+
44+ fmt.Println (err.Error ())
45+
4146 err.Log ()
4247}
4348```
4449Output:
4550
4651``` console
47- 2017/08/31 11:59:54 Error Stacktrace:
48- -> github.com/efimovalex/stackerr/example/main.go:24 (main.main)
49- -> github.com/efimovalex/stackerr/example/main.go:18 (main.(*t1).f3)
50- -> github.com/efimovalex/stackerr/example/main.go:11 (main.f2)
51- -> github.com/efimovalex/stackerr/example/main.go:6 (main.f1)
52+ Error Stacktrace:
53+ -> github.com/efimovalex/stackerr/example/main.go:25 (main.main)
54+ -> github.com/efimovalex/stackerr/example/main.go:19 (main.(*t1).f3)
55+ -> github.com/efimovalex/stackerr/example/main.go:12 (main.f2)
56+ -> github.com/efimovalex/stackerr/example/main.go:7 (main.f1)
57+
58+ message
59+
60+ 2017/08/31 12:13:47 Error Stacktrace:
61+ -> github.com/efimovalex/stackerr/example/main.go:25 (main.main)
62+ -> github.com/efimovalex/stackerr/example/main.go:19 (main.(*t1).f3)
63+ -> github.com/efimovalex/stackerr/example/main.go:12 (main.f2)
64+ -> github.com/efimovalex/stackerr/example/main.go:7 (main.f1)
5265```
5366## Authors
5467
0 commit comments