Errors package

This commit is contained in:
Matthew Dillon 2015-10-01 14:45:36 -07:00
parent 0eec85ed08
commit a880fdea82
24 changed files with 215 additions and 169 deletions

View file

@ -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,
}
}

View file

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