=Error Handling=
==Raise XQuery Errors==
{{Mark|Updated with Version 9.3}}:
If an error is raised during the evaluation of a RESTXQ function, an HTTP response with the status code 400 is generated. The response body contains the full error message and stack trace.
With the {{Function|Web|web:error}} function, you can generate responses with abort query evaluation and enforce a custom status codepremature HTTP response: You can also define custom error codes by using the third argument of the error function…
<pre class="brush:xquery">