CatchError is the unified exception handler
(title string, logtarget string, err interface{})
| 8 | |
| 9 | // CatchError is the unified exception handler |
| 10 | func CatchError(title string, logtarget string, err interface{}) (errmsg string) { |
| 11 | errmsg = fmt.Sprintln(err) |
| 12 | stack := string(debug.Stack()) |
| 13 | os.Stdout.Write([]byte(title + " error! => " + errmsg + " => " + stack)) |
| 14 | return title + " error! => " + errmsg + " => " + stack |
| 15 | } |
no test coverage detected