History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-879
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Marcus Griep
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Exception Handling: Allow for exception filters

Created: 27/Sep/07 08:36 PM   Updated: 26/Oct/07 09:20 PM
Component/s: Parser, Emitter, Compiler
Affects Version/s: 0.7.9
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

File Attachments: 1. Text File exception.patch (27 kb)
2. Text File exception.redux.patch (27 kb)
3. Text File exceptions.redux2.patch (45 kb)

Issue Links:
Related
Supercedes
 

Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
The CLI currently provides a mechanism, 'filter', so that it will only handle an exception if a condition holds:

For an example: http://dotnet.org.za/armand/archive/2005/11/09/48087.aspx and http://www.microsoft.com/mspress/books/sampchap/5771.aspx

proposed syntax:

except ex as SomeException if arg is not null:
  print "arg is not null, so I'll handle it"
except as SomeException if ItDidntWork():
  print "It Didn't Work, but I'll handle it."
except unless boolArg:
  print "boolArg was true, so I'll handle it."


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marcus Griep - 06/Oct/07 09:54 PM
A smaller, more succinct, and complete patch file for all linked exception issues.

Marcus Griep - 25/Oct/07 04:04 PM
Modified cases to use (if/unless) now that when is no longer reserved. New patch to be uploaded soon.

Marcus Griep - 25/Oct/07 04:51 PM
New patch with linked up tests.

Rodrigo B. de Oliveira - 25/Oct/07 05:00 PM
Could you use Declaration with a null name instead of adding a TypeReference field to ExceptionHandler?

Marcus Griep - 26/Oct/07 12:03 PM
Updated to no longer use a TypeReference in the Exception Handler and to properly implement "Option B" (Fault block executes on uncaught exceptions, before finally). Includes comments in Emit Assembly detailing workaround necessary due to shortcoming in Reflection.Emit.ILGenerator.

Marcus Griep - 26/Oct/07 12:07 PM
Small fix. (Accidentally included non-germane patch stuffs)

Marcus Griep - 26/Oct/07 12:24 PM
Complete and fully re-tested. (Why do patch files have to be so picky )

Marcus Griep - 26/Oct/07 09:20 PM
Revision 2744