Public bug reported:

Errors might not be caught by a try-catch expression if they are raised
during the creation of a temporary index. The following example should
return "caught" but instead the error is propagated up.

declare function local:foo() as element()*
{
  for $i in 1 to 10
  return if ($i mod 2 eq 0) then <a id="{$i}"/> else fn:error()
};

declare function local:bar() as element()*
{
  for $i in 1 to 10
  return <b id="{$i}"/>
};

try {
  for $i in local:bar()/@id
  for $j in local:foo()/@id
  where xs:string($i)  eq xs:string($j)
  return $i
} catch * {
  "caught"
}

** Affects: zorba
     Importance: High
     Assignee: Markos Zaharioudakis (markos-za)
         Status: New

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/967428

Title:
  errors not caught if raised during temp index creation

Status in Zorba - The XQuery Processor:
  New

Bug description:
  Errors might not be caught by a try-catch expression if they are
  raised during the creation of a temporary index. The following example
  should return "caught" but instead the error is propagated up.

  declare function local:foo() as element()*
  {
    for $i in 1 to 10
    return if ($i mod 2 eq 0) then <a id="{$i}"/> else fn:error()
  };

  declare function local:bar() as element()*
  {
    for $i in 1 to 10
    return <b id="{$i}"/>
  };

  try {
    for $i in local:bar()/@id
    for $j in local:foo()/@id
    where xs:string($i)  eq xs:string($j)
    return $i
  } catch * {
    "caught"
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/967428/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to