1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-30 10:11:23 +02:00
woodpecker/vendor/github.com/denisenkom/go-mssqldb/error.go
2015-09-29 18:21:17 -07:00

40 lines
636 B
Go

package mssql
import (
"fmt"
)
type Error struct {
Number int32
State uint8
Class uint8
Message string
ServerName string
ProcName string
LineNo int32
}
func (e Error) Error() string {
return "mssql: " + e.Message
}
type StreamError struct {
Message string
}
func (e StreamError) Error() string {
return e.Message
}
func streamErrorf(format string, v ...interface{}) StreamError {
return StreamError{"Invalid TDS stream: " + fmt.Sprintf(format, v...)}
}
func badStreamPanic(err error) {
panic(err)
}
func badStreamPanicf(format string, v ...interface{}) {
panic(streamErrorf(format, v...))
}