This API returns a HTTP code different than "200 OK" only when a serious condition is encountered:
For other errors, a plain text content with mime type:
text/x-qizx-error; charset=UTF-8.
is returned with a code 200. The format is described below.
Rationale: this choice is made so that errors can be handled even by some broken HTTP client libraries which cannot test the HTTP code properly.
The first line contains a name followed by a colon. The rest of the line is a message explaining the error briefly.
Compilation: syntax error, unrecognized characters at end of query
XQuery compile time error, in syntax or static analysis.
The next lines contain the location and message of each error.
XQuery evaluation error.
The description line begin with the XQuery error code. The next lines contain the XQuery stack trace.
Example:
Evaluation: FORG0001 cannot cast to xs:int : invalid value 'a' for integer type in my:func ( ) as xs:int at line 2 column 6 at line 1 column 4