2018-11-13 22:47:08 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-04-03 00:03:46 +08:00
|
|
|
"github.com/gogf/gf/g"
|
|
|
|
"github.com/gogf/gf/g/os/glog"
|
2018-11-13 22:47:08 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-04-03 00:03:46 +08:00
|
|
|
g.TryCatch(func() {
|
2019-06-03 20:58:30 +08:00
|
|
|
glog.Println("hello")
|
2019-04-03 00:03:46 +08:00
|
|
|
g.Throw("exception")
|
2019-06-03 20:58:30 +08:00
|
|
|
glog.Println("world")
|
|
|
|
})
|
|
|
|
|
|
|
|
g.TryCatch(func() {
|
|
|
|
glog.Println("hello")
|
|
|
|
g.Throw("exception")
|
|
|
|
glog.Println("world")
|
2019-04-03 00:03:46 +08:00
|
|
|
}, func(exception interface{}) {
|
|
|
|
glog.Error(exception)
|
|
|
|
})
|
|
|
|
}
|