Wiki

Changes between Version 1 and Version 2 of Throw

Show
Ignore:
Timestamp:
11/22/10 20:25:03 (8 years ago)
Author:
todd.a
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Throw

    v1 v2  
    55The thrown exception is an object whose class is derived from System.Exception, for example: 
    66{{{ 
     7#!cobra 
    78class MyException inherits System.Exception 
    89    pass 
     
    1516You can also rethrow a caught exception using the throw statement by specifying the caught exception 
    1617{{{ 
     18#!cobra 
    1719catch exc as MyException 
    1820    if passOn 
     
    2830== Example == 
    2931{{{ 
     32#!cobra 
    3033class ThrowTest 
    3134    def getNumber(index as int) as int