mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 11:27:50 +00:00
changed out of range error message name and fixed formatting
This commit is contained in:
parent
b770167db6
commit
6ba6218ae4
2 changed files with 4 additions and 3 deletions
|
|
@ -160,7 +160,7 @@ func (q *Query) addNumVal(val string) {
|
|||
ival, err = strconv.ParseInt(val, 10, 64)
|
||||
}
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("out of bounds: %s", err))
|
||||
panic(fmt.Sprintf("%s: %s", intOutOfRangeError, err))
|
||||
}
|
||||
if elem.inList {
|
||||
if elem.lastCond != ILLEGAL {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const timeFormat = "2006-01-02T15:04"
|
|||
|
||||
// error strings in the parser
|
||||
const duplicateArgErrorMessage = "duplicate argument provided"
|
||||
const outOfBoundsErrorMessage = "out of bounds"
|
||||
const intOutOfRangeError = "integer is not in signed 64-bit range"
|
||||
|
||||
// parser represents a parser for the PQL language.
|
||||
type parser struct {
|
||||
|
|
@ -72,7 +72,8 @@ func (p *parser) Parse() (*Query, error) {
|
|||
p.Execute()
|
||||
}()
|
||||
if v != nil {
|
||||
if strings.HasPrefix(v.(string), duplicateArgErrorMessage) || strings.HasPrefix(v.(string), outOfBoundsErrorMessage) {
|
||||
errorMessage := v.(string)
|
||||
if strings.HasPrefix(errorMessage, duplicateArgErrorMessage) || strings.HasPrefix(errorMessage, intOutOfRangeError) {
|
||||
return nil, fmt.Errorf("%s", v)
|
||||
} else {
|
||||
panic(v)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue