Skip to content

Commit aa35cb8

Browse files
Clarify the exact error type (#162)
1 parent 4cf42d9 commit aa35cb8

File tree

9 files changed

+9
-8
lines changed

9 files changed

+9
-8
lines changed

GRAMMAR.ABNF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ slice-expression = [number] ":" [number] [ ":" [number] ] ;; ## Slices
341341
;; - If no `stop` position is given, it is assumed to be the length of the array or string if the given `step` is greater than `0` or `0` if
342342
;; the given `step` is less than `0`.
343343
;; - If the given `step` is omitted, it it assumed to be `1`.
344-
;; - If the given `step` is `0`, an error MUST be raised.
344+
;; - If the given `step` is `0`, an `invalid-value` error MUST be raised.
345345
;; - If the element being sliced is not an array or a string, the result is `null`.
346346
;; - If the element being sliced is an array or string and yields no results, the result MUST be an empty array.
347347
;;

function_schema.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ definitions:
109109
type: string
110110
enum:
111111
- invalid-arity
112+
- invalid-value
112113
- invalid-type
113114
- not-a-number
114115
- syntax

functions/abs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ returns:
1212
desc: |
1313
Returns the absolute value of the provided argument. The signature indicates
1414
that a number is returned, and that the input argument `$value` **must**
15-
resolve to a number, otherwise a `invalid-type` error is triggered.
15+
resolve to a number, otherwise an `invalid-type` error is triggered.
1616
1717
Below is a worked example. Given:
1818

functions/group_by.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ desc: |
2323
This includes objects for which applying the `$expr` expression evaluates to `null`.
2424
2525
If the result of applying the `$expr` expression against the current array element
26-
results in type other than `string` or `null`, a type error MUST be raised.
26+
results in type other than `string` or `null`, an `invalid-type` error MUST be raised.
2727
examples:
2828
group_by:
2929
context:

functions/sort_by.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ desc: |
1818
resulting value is used as the key used when sorting the `elements`.
1919
2020
If the result of evaluating the `expr` against the current array element
21-
results in type other than a `number` or a `string`, a type error will
21+
results in type other than a `number` or a `string`, an `invalid-type` error will
2222
occur.
2323
2424
Below are several examples using the `people` array (defined above) as the

jep-003-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ number abs(number $value)
189189

190190
Returns the absolute value of the provided argument. The signature indicates
191191
that a number is returned, and that the input argument `$value` **must**
192-
resolve to a number, otherwise a `invalid-type` error is triggered.
192+
resolve to a number, otherwise an `invalid-type` error is triggered.
193193

194194
Below is a worked example. Given:
195195

jep-003a-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ number abs(number $value)
195195

196196
Returns the absolute value of the provided argument. The signature indicates
197197
that a number is returned, and that the input argument `$value` **must**
198-
resolve to a number, otherwise a `invalid-type` error is triggered.
198+
resolve to a number, otherwise an `invalid-type` error is triggered.
199199

200200
Below is a worked example. Given:
201201

jep-005-array-slices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ the given step is greater than 0 or 0 if the given step is less than 0.
8686
5. If the given step is omitted, it it assumed to be 1.
8787

8888

89-
6. If the given step is 0, an error must be raised.
89+
6. If the given step is 0, an `invalid-value` error must be raised.
9090

9191

9292
7. If the element being sliced is not an array, the result must be `null`.

jep-018-grouping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Objects that do not match the group criteria are discarded from the output.
3030
This includes objects for which applying the `$expr` expression evaluates to `null`.
3131

3232
If the result of applying the `$expr` expression against the current array element
33-
results in type other than `string` or `null`, a type error MUST be raised.
33+
results in type other than `string` or `null`, an `invalid-type` error MUST be raised.
3434

3535
### Examples
3636

0 commit comments

Comments
 (0)