diff --git a/docs/usage/expressions.md b/docs/usage/expressions.md index a0f126b..a37e908 100644 --- a/docs/usage/expressions.md +++ b/docs/usage/expressions.md @@ -335,11 +335,11 @@ The following error strings may be returned while compiling or evaluating your e ```go const ( - ErrorBucket = "" // Unable to bucket from given value (wrong type) - ErrorBucketSize = "" // Unable to get the size of the bucket (wrong type) - ErrorType = "" // Error parsing the principle value of the input because of unexpected type - ErrorParsing = "" // Error parsing the principle value of the input - ErrorArgCount = "" // Function to not support a variation with the given argument count - ErrorArgName = "" // A variable accessed by a given name does not exist + ErrorType = "" // Error parsing the principle value of the input because of unexpected type + ErrorParsing = "" // Error parsing the principle value of the input (non-numeric) + ErrorArgCount = "" // Function to not support a variation with the given argument count + ErrorConst = "" // Expected constant value + ErrorEnum = "" // A given value is not contained within a set + ErrorArgName = "" // A variable accessed by a given name does not exist ) ``` diff --git a/pkg/expressions/stdlib/errors.go b/pkg/expressions/stdlib/errors.go index 88779b3..05596a0 100644 --- a/pkg/expressions/stdlib/errors.go +++ b/pkg/expressions/stdlib/errors.go @@ -1,10 +1,10 @@ package stdlib const ( - ErrorBucket = "" // Unable to bucket from given value (wrong type) - ErrorBucketSize = "" // Unable to get the size of the bucket (wrong type) - ErrorType = "" // Error parsing the principle value of the input because of unexpected type - ErrorParsing = "" // Error parsing the principle value of the input - ErrorArgCount = "" // Function to not support a variation with the given argument count - ErrorArgName = "" // A variable accessed by a given name does not exist + ErrorType = "" // Error parsing the principle value of the input because of unexpected type + ErrorParsing = "" // Error parsing the principle value of the input (non-numeric) + ErrorArgCount = "" // Function to not support a variation with the given argument count + ErrorConst = "" // Expected constant value + ErrorEnum = "" // A given value is not contained within a set + ErrorArgName = "" // A variable accessed by a given name does not exist ) diff --git a/pkg/expressions/stdlib/funcsCommon.go b/pkg/expressions/stdlib/funcsCommon.go index fcec556..5082a6a 100644 --- a/pkg/expressions/stdlib/funcsCommon.go +++ b/pkg/expressions/stdlib/funcsCommon.go @@ -26,12 +26,12 @@ func kfBucket(args []KeyBuilderStage) KeyBuilderStage { return KeyBuilderStage(func(context KeyBuilderContext) string { val, err := strconv.Atoi(args[0](context)) if err != nil { - return ErrorBucket + return ErrorType } bucketSize, err := strconv.Atoi(args[1](context)) if err != nil { - return ErrorBucketSize + return ErrorType } return strconv.Itoa((val / bucketSize) * bucketSize) diff --git a/pkg/expressions/stdlib/funcsTime.go b/pkg/expressions/stdlib/funcsTime.go index fb00953..1f63729 100644 --- a/pkg/expressions/stdlib/funcsTime.go +++ b/pkg/expressions/stdlib/funcsTime.go @@ -214,7 +214,7 @@ func timeBucketToFormat(name string) string { } else if isPartialString(name, "years") { return "2006" } - return ErrorBucket + return ErrorEnum } // {func