Skip to content

Commit c4654c0

Browse files
committed
Expand on the relaxed error message checking
1 parent 1b14f00 commit c4654c0

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

README.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,28 @@ have the following interface:
8888
* Accept the input JSON data on stdin.
8989
* Accept the jmespath expression as an argument.
9090
* Print the jmespath result as JSON on stdout.
91-
* If an error occurred, it must write the error name to sys.stderr. The error
92-
name must be the first thing written to stderr, but it is free to write
93-
information after the error name. For example "syntax: Expression did not
94-
compile 'foo.bar.'" would be a valid message to indicate that a syntax error
95-
occurred because it starts with "syntax".
91+
* If an error occurred, it must write the error name to sys.stderr. This
92+
check is case insensitive.
93+
The error types in the compliance tests are hyphenated, but each
94+
individual component may appear in stderr (again case insensitive).
95+
96+
Here are a few examples of error messages that would pass ``jp-compliance``:
97+
98+
* Error type: ``unknown-function``
99+
* Valid error messages:
100+
101+
* ``unknown-function: somefunction()``
102+
* ``error: unknown function 'somefunction()``
103+
* ``Unknown function: somefunction()``
104+
105+
* Error type: ``syntax``
106+
* Valid error messages:
107+
108+
* ``syntax: Unknown token '$'``
109+
* ``syntax-error: Unknown token '$'``
110+
* ``Syntax error: Unknown token '$'``
111+
* ``An error occurred: Syntax error, unknown token '$'``
112+
96113

97114
.. note::
98115

0 commit comments

Comments
 (0)