[Bug 29758] New: [FO31] What is the sort order of errors?

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29758

            Bug ID: 29758
           Summary: [FO31] What is the sort order of errors?
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: abel.braaksma@xs4all.nl
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

Going over the function array:sort, the second argument takes a higher order
function. Such function could return an error. I wonder what is supposed to
happen then.

Under "Error conditions" there is no mention that array:sort fails if this
function returns an error.

Does this mean that if the second arg function returns an error, that such
error should be ignored, and if so, it is sortable? Or can I deduct and say "it
is not comparable using the le operator", so the mentioned dynamic error (no
specific error code is given) applies?

In the latter case it becomes a matter of definition: does the function raise
an error and does that error bubble up, or does array:sort return (some)
implementation-dependent error as mentioned in this section?

I think I would prefer to add a line to "Error conditions". Something like:

"If evaluation of $key results in an error being raised, the function
array:sort fails with that error."

Example (contrived):

array:sort($arr, function($val) { fn:error("e:MYERR", "Some error") } )

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 28 July 2016 10:50:40 UTC