[MarkLogic Dev General] fn:error and error code

Steve Spigarelli spig at spig.net
Tue Mar 6 10:25:17 PST 2012


I've noticed that in the documentation for the fn:error function that the
first parameter can be an xs:QName for the error code. However, when I
xdmp:log the caught error I get the code in the name and the name in the
code field.

Here is the code that I'm running:

xquery version "1.0-ml";

module namespace test = "test-error";

declare function test-error() {
    try {
    fn:error(xs:QName("MY-ERROR"), "my test error", ())
    } catch ($e) {
        xdmp:log($e)
    }
};

and here is what I get in the resulting error xml:

...
<error:code>my test error</error:code>
  <error:name>MY-ERROR</error:name>
...


Any idea why this works this way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20120306/9b7c6a7d/attachment.html 


More information about the General mailing list