[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|NEW                         |ASSIGNED

--- Comment #3 from Jonathan Robie <jonathan.robie@redhat.com> 2011-03-01 17:17:15 UTC ---
In yesterday's telcon, we discussed simplifying the description of try/catch as
follows (this version of the text has not been reviewed, so I am not closing
the bug yet).

<quote>
A try/catch expression catches dynamic errors and type errors raised
as a result of evaluating the TryTargetExpression. If the
TryTargetExpression does not raise a dynamic error or a type error,
the result of the try/catch expression is the result of the target
expression.
</quote>

To be clear about the edge cases we have discussed, we would like to add these
to the current list of Examples:

<quote>
Variable references do not raise errors, even if the initializing
expressions for their variable declarations do.

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

Errors raised in function calls are caught if they are evaluated as a
result of evaluating the TryTargetExpression:

 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 TryTargetExpression:

 try {
   let $x := 1 div 0
   return $x
 }
 catch {
   0
 }
</quote>

-- 
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:17:18 UTC