[Bug 11547] [XQuery3] Scope of try-catch.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11547

Jonathan Robie <jonathan.robie@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Jonathan Robie <jonathan.robie@redhat.com> 2011-03-01 17:55:26 UTC ---
The Working Group accepted Comment #3 as the resolution of this bug, modulo
editorial changes. I've modified the text for the examples as follows:

Variable references do not raise errors, even if the initializing
expressions for their variable declarations do. The following query
raises an error in the binding expression of the variable declaration,
so the query does not return a value:

 declare variable $x := 1 div 0;
 try { $x } catch { 42 }

The error in the above query can be caught using a try/catch
expression in the binding expression for the variable:

 declare variable $x := try { 1 div 0 } catch { 42 };

Errors raised in function calls are caught if they are evaluated as a
result of evaluating the TryTargetExpr.  The following query returns
the value 42:

 declare function f() { 1 div 0 };
 try { f() } catch { 42 }

Errors raised in binding expressions are caught if they are evaluated
as a result of evaluating the TryTargetExpr.  The following query
returns the value 42:

 try {
   let $x := 1 div 0
   return $x
 }
 catch {
   42
 }

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 1 March 2011 17:55:28 UTC