diff --git a/internal/errors/migrated_errors.go b/internal/errors/migrated_errors.go index 6ef98da8b..a709a3ee6 100644 --- a/internal/errors/migrated_errors.go +++ b/internal/errors/migrated_errors.go @@ -33,8 +33,7 @@ var ( ErrInvalidIPAddress = errors.New("invalid IP address") ErrInvalidFingerprint = errors.New("invalid fingerprint") ErrKeyDoesNotExist = errors.New("ERR could not perform this operation on a key that doesn't exist") - ErrInvalidFloat = errors.New("ERR value is not a valid float") - ErrUnsupportedUnit = errors.New("ERR unsupported unit provided. please use m, km, ft, mi") + ErrUnsupportedUnit = errors.New("ERR unsupported unit provided. please use M, KM, FT, MI") // Error generation functions for specific error messages with dynamic parameters. ErrWrongArgumentCount = func(command string) error { diff --git a/internal/eval/store_eval.go b/internal/eval/store_eval.go index bc687b9c5..eccfbbbf5 100644 --- a/internal/eval/store_eval.go +++ b/internal/eval/store_eval.go @@ -6989,7 +6989,7 @@ func parseGeoRadiusOpts(args []string) (*geoRadiusOpts, error) { } i++ } else { - return nil, diceerrors.ErrGeneral("syntax error") + return nil, diceerrors.ErrSyntax } case "ANY": return nil, diceerrors.ErrGeneral("the ANY argument requires COUNT argument") @@ -7002,7 +7002,7 @@ func parseGeoRadiusOpts(args []string) (*geoRadiusOpts, error) { opts.StoreDist = false i++ } else { - return nil, diceerrors.ErrGeneral("syntax error") + return nil, diceerrors.ErrSyntax } case "STOREDIST": if opts.WithCoord || opts.WithDist || opts.WithHash { @@ -7013,10 +7013,10 @@ func parseGeoRadiusOpts(args []string) (*geoRadiusOpts, error) { opts.StoreDist = true i++ } else { - return nil, diceerrors.ErrGeneral("syntax error") + return nil, diceerrors.ErrSyntax } default: - return nil, diceerrors.ErrGeneral("syntax error") + return nil, diceerrors.ErrSyntax } } @@ -7027,7 +7027,7 @@ func evalGEORADIUSBYMEMBER(args []string, store *dstore.Store) *EvalResponse { if len(args) < 4 { return &EvalResponse{ Result: nil, - Error: diceerrors.ErrWrongArgumentCount("GEODIST"), + Error: diceerrors.ErrWrongArgumentCount("GEORADIUSBYMEMBER"), } } @@ -7039,7 +7039,8 @@ func evalGEORADIUSBYMEMBER(args []string, store *dstore.Store) *EvalResponse { distVal, parseErr := strconv.ParseFloat(dist, 64) if parseErr != nil { return &EvalResponse{ - Error: diceerrors.ErrInvalidFloat, + Result: nil, + Error: diceerrors.ErrGeneral("need numeric radius"), } } @@ -7054,14 +7055,16 @@ func evalGEORADIUSBYMEMBER(args []string, store *dstore.Store) *EvalResponse { obj := store.Get(key) if obj == nil { return &EvalResponse{ - Result: clientio.NIL, + Result: clientio.EmptyArray, + Error: nil, } } ss, err := sortedset.FromObject(obj) if err != nil { return &EvalResponse{ - Error: diceerrors.ErrWrongTypeOperation, + Result: nil, + Error: diceerrors.ErrWrongTypeOperation, } } @@ -7069,7 +7072,7 @@ func evalGEORADIUSBYMEMBER(args []string, store *dstore.Store) *EvalResponse { if !ok { return &EvalResponse{ Result: nil, - Error: nil, + Error: diceerrors.ErrGeneral("could not decode requested zset member"), } }