Changes

Jump to navigation Jump to search
279 bytes added ,  13:23, 18 July 2019
no edit summary
</pre>
An XQuery error in a RESTXQ context delivers by default a HTTP status code 400 error back to the client. However, you can also define a custom error code by using the third argument of the error function. {{Mark|Updated with Version 9.3}}: If the error code has the RESTXQ namespace, the stack trace and the error code will be suppressed in the client output:
<pre class="brush:xquery">
%rest:path("/teapot")
function page:teapot() {
fn:error(xs:QName('rest:error'), "I'm a teapot", 418)
};
</pre>
=Changelog=
 
;Version 9.3
 
* Updated: [[#XQuery Errors|XQuery Errors]]: Suppress stack trace and error code in the HTTP response.
;Version 9.2
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu