示例#1
0
文件: try_test.go 项目: bjarneh/try
func dangarous2(fail bool) (e error) {
	defer try.Catch(&e)
	if fail {
		panic(errors.New("panic with os.Error"))
	} else {
		e = errors.New("Plain old os.Error")
	}
	return
}
示例#2
0
文件: try_test.go 项目: bjarneh/try
func dangarous(fail bool) (e error) {
	defer try.Catch(&e)
	if fail {
		panic("I've failed you")
	} else {
		e = errors.New("Plain old os.Error")
	}
	return
}