Changes

Jump to navigation Jump to search
2 bytes removed ,  19:13, 22 June 2013
The XQuery [[XQuery 3.0#Try.2FCatch|try/catch]] construct assigns error information to a number of pre-defined variables ({{Code|code}}, {{Code|description}}, {{Code|value}}, {{Code|module}}, {{Code|line-number}}, {{Code|column-number}}, {{Code|additional}}). These variables can be bound to variables via ''error parameter annotations'', which are specified the same way as [[#Query Parameters|query parameters]].
Errors may occur unexpectedly. However, they can also be generated in triggered by a query, as the following example shows:
<pre class="brush:xquery">
declare %rest:path("/check/{$user}") function page:check($user) {
if($user = ('jack', 'lisa'))
then 'Everything okUser exists'
else fn:error(xs:QName('err:user'), $user)
};
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu