clair/vendor/github.com/ziutek/mymysql/native/common.go
2016-02-24 16:34:54 -05:00

26 lines
321 B
Go

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)
}
}
}