clair/vendor/github.com/ziutek/mymysql/native/common.go

26 lines
321 B
Go
Raw Normal View History

2016-01-27 22:08:08 +00:00
package native
import (
"io"
"runtime"
)
var tab8s = " "
func catchError(err *error) {
if pv := recover(); pv != nil {
switch e := pv.(type) {
case runtime.Error:
panic(pv)
case error:
if e == io.EOF {
*err = io.ErrUnexpectedEOF
} else {
*err = e
}
default:
panic(pv)
}
}
}