This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
It appeared to me that fn:error [1] lacks a clear description of how omitted arguments are filled. We currently assume that fn:error(X) means that $description is filled (may be filled) with the error description as defined in the XPath language for that error, if the EQName resolves to an error in either the XPath language spec or in a host language spec. This is in line with raising (known/defined) exceptions in other languages. However, it is also possible that this is not allowed and that $description must be empty in this case. When the EQName doesn't resolve to a known error, we currently assume $description to be the empty string. Though even in this case, perhaps an implementation can define a predefined value for $description if the error is a known implementation-defined error. Likewise, for $error-object: is it implementation defined when omitted, or must it be the empty sequence? I think allowing implementations some freedom for filling $description and $error-object can be beneficial for users.
Forgot to add reference to [1]: http://www.w3.org/TR/xpath-functions-30/#func-error
The working group looked at this and decided that although F+O does not clearly describe what happens when no error description or error value are supplied, the rules for XQuery 3.0 try/catch fill this gap, and therefore the problem is not sufficiently severe to justify a spec change before advancing to Recommendation. However, there is scope for better explanation of the situation, so the bug is being reclassified as an editorial bug against 3.1.
This deficiency was accepted on 2014-04-29. The editor has an action to propose the detailed words. The intent is to specify that for arguments left unspecified, e.g. the description and the error object, the value as observed in a catch clause will be implementation dependent.
Proposed change: add the following two rules: <p diff="add" at="B-bug24359">If no value is supplied for the <code>$description</code> argument (that is, if the function is called with less than two arguments), then the effective value of the description is <termref def="implementation-dependent"/>.</p> <p diff="add" at="B-bug24359">If no value is supplied for the <code>$error-object</code> argument (that is, if the function is called with less than three arguments), then the effective value of the error object is <termref def="implementation-dependent"/>.</p>
The proposal in comment #4 was accepted.