Errors package
This commit is contained in:
parent
0eec85ed08
commit
a880fdea82
24 changed files with 215 additions and 169 deletions
|
@ -19,10 +19,3 @@ type AppError struct {
|
|||
Error error
|
||||
Status int
|
||||
}
|
||||
|
||||
func NewJSONError(err error, status int) *AppError {
|
||||
return &AppError{
|
||||
Error: ErrorJSON{Err: err},
|
||||
Status: status,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/thermokarst/bactdb/errors"
|
||||
)
|
||||
|
||||
type NullSliceInt64 []int64
|
||||
|
@ -11,7 +12,7 @@ type NullSliceInt64 []int64
|
|||
func (i *NullSliceInt64) Scan(src interface{}) error {
|
||||
asBytes, ok := src.([]byte)
|
||||
if !ok {
|
||||
return errors.New("Scan source was not []byte")
|
||||
return errors.SourceNotByteSlice
|
||||
}
|
||||
asString := string(asBytes)
|
||||
(*i) = strToIntSlice(asString)
|
||||
|
|
Reference in a new issue