<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Exceptions</title><link>https://sourceforge.net/p/asil/wiki/Exceptions/</link><description>Recent changes to Exceptions</description><atom:link href="https://sourceforge.net/p/asil/wiki/Exceptions/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 16 Feb 2014 10:28:57 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/asil/wiki/Exceptions/feed" rel="self" type="application/rss+xml"/><item><title>Exceptions modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Exceptions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -18,6 +18,7 @@
 The **[throws](keywords-throws)** keyword can be applied to any procedure as shown below.

 ~~~~
+:::text
 command DoThis
     throws Exception
   ' Run some code that might throw Exception
@@ -28,6 +29,7 @@
 If a property needs to throw an exception, the **[throws](keywords-throws)** clause should be applied to the accessor, not the property.

 ~~~~
+:::text
 property String MyProp
   get
       throws Exception
@@ -42,6 +44,7 @@
 If you need to **[catch](keywords-catch)** rather than declare an exception, use this syntax:

 ~~~~
+:::text
 try
   ' code that might throw an exception
 catch Exception e
@@ -53,6 +56,7 @@
 This sample show how to handle multiple exception types:

 ~~~~
+:::text
 try
   ' code that might throw several different types of exceptions
 catch ExceptionA e
@@ -68,6 +72,7 @@
 You can use a **[finally](keywords-finally)** block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.

 ~~~~
+:::text
 try
   ' Code the might throw an exception
 catch Exception e
@@ -81,6 +86,7 @@
 If you're declaring exceptions rather than catching them, you still might want a **[try](keywords-try)** block so you can have a **[finally](keywords-finally)** block clean up.

 ~~~~
+:::text
 command CallMe
     throws Exception
   try
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sun, 16 Feb 2014 10:28:57 -0000</pubDate><guid>https://sourceforge.net4eb5b15f6c0da0d2ebdc0ee25c05232b9bb4f221</guid></item><item><title>Exceptions modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Exceptions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -8,14 +8,14 @@
 Exception base class/interface | What it does
 -------------------------------|-------------
 IThrowable | All exception classes must implement this interface
-Exception | If a property or procedure throws anything of type Exception or any class derived from Exception, it must be declared with the [**throws**] clause or handled with a [**try**]/[**catch**] block.
-Error | This is an [**abstract**] class whose derived types don't need to be caught.  They are meant for dynamic errors.
+Exception | If a property or procedure throws anything of type Exception or any class derived from Exception, it must be declared with the **[throws](keywords-throws)** clause or handled with a **[try](keywords-try)**/**[catch](keywords-catch)** block.
+Error | This is an **[abstract](keywords-abstract)** class whose derived types don't need to be caught.  They are meant for dynamic errors.

 Even though exceptions of type Error don't need to be caught, all compilers should provide an option to require instances of an Error type and its derivatives to be caught.  This could be useful when the author of a exception class use Error when they should have picked Exception as their base type.

-The [**throws**] clause
+The **[throws](keywords-throws)** clause
 -----------------
-The [**throws**] keyword can be applied to any procedure as shown below.
+The **[throws](keywords-throws)** keyword can be applied to any procedure as shown below.

 ~~~~
 command DoThis
@@ -23,9 +23,9 @@
   ' Run some code that might throw Exception
 ~~~~

-The [**throws**] clause in properties
+The **[throws](keywords-throws)** clause in properties
 -----------------------------------
-If a property needs to throw an exception, the [**throws**] clause should be applied to the accessor, not the property.
+If a property needs to throw an exception, the **[throws](keywords-throws)** clause should be applied to the accessor, not the property.

 ~~~~
 property String MyProp
@@ -37,9 +37,9 @@
   ' This accessor doesn't throw any exceptions
 ~~~~

-Simple [**try**]/[**catch**] blocks
+Simple **[try](keywords-try)**/**[catch](keywords-catch)** blocks
 -----------------------
-If you need to [**catch**] rather than declare an exception, use this syntax:
+If you need to **[catch](keywords-catch)** rather than declare an exception, use this syntax:

 ~~~~
 try
@@ -48,7 +48,7 @@
   ' handle the exception
 ~~~~

-Multiple [**catch**] blocks for one [**try**] block
+Multiple **[catch](keywords-catch)** blocks for one **[try](keywords-try)** block
 ---------------------------------------
 This sample show how to handle multiple exception types:

@@ -65,7 +65,7 @@

 Finally blocks
 --------------
-You can use a [**finally**] block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.
+You can use a **[finally](keywords-finally)** block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.

 ~~~~
 try
@@ -76,9 +76,9 @@
   ' clean up
 ~~~~

-Try blocks with a [**finally**] block but no [**catch**] blocks
+Try blocks with a **[finally](keywords-finally)** block but no **[catch](keywords-catch)** blocks
 ---------------------------------------------------
-If you're declaring exceptions rather than catching them, you still might want a [**try**] block so you can have a [**finally**] block clean up.
+If you're declaring exceptions rather than catching them, you still might want a **[try](keywords-try)** block so you can have a **[finally](keywords-finally)** block clean up.

 ~~~~
 command CallMe
@@ -91,4 +91,4 @@

 Possible syntax errors
 ----------------------
-If you have a [**try**] block, you must either follow it with at least one [**catch**] block or a [**finally**] block.  All compilers must catch this situation.
+If you have a **[try](keywords-try)** block, you must either follow it with at least one **[catch](keywords-catch)** block or a **[finally](keywords-finally)** block.  All compilers must catch this situation.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Thu, 13 Feb 2014 23:20:24 -0000</pubDate><guid>https://sourceforge.net2ecd4e7aa516dd2075a17f79bfd10d9a8e61280e</guid></item><item><title>Exceptions modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Exceptions/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -7,15 +7,15 @@

 Exception base class/interface | What it does
 -------------------------------|-------------
-IThrowable | All exception classes must inherit this interface
-Exception | If a property or procedure throws anything of type Exception or any class derived from Exception, it must be declared with the **throws** clause or handled with a try/catch block.
-Error | This is an abstract class whose derived types don't need to be caught.  They are meant for  dynamic errors.
+IThrowable | All exception classes must implement this interface
+Exception | If a property or procedure throws anything of type Exception or any class derived from Exception, it must be declared with the [**throws**] clause or handled with a [**try**]/[**catch**] block.
+Error | This is an [**abstract**] class whose derived types don't need to be caught.  They are meant for dynamic errors.

 Even though exceptions of type Error don't need to be caught, all compilers should provide an option to require instances of an Error type and its derivatives to be caught.  This could be useful when the author of a exception class use Error when they should have picked Exception as their base type.

-The **throws** clause
+The [**throws**] clause
 -----------------
-The [throws] keyword can be applied to any procedure as shown below.
+The [**throws**] keyword can be applied to any procedure as shown below.

 ~~~~
 command DoThis
@@ -23,9 +23,9 @@
   ' Run some code that might throw Exception
 ~~~~

-The **throws** clause in properties
+The [**throws**] clause in properties
 -----------------------------------
-If a property needs to throw an exception, the **throws** clause should be applied to the accessor, not the property.
+If a property needs to throw an exception, the [**throws**] clause should be applied to the accessor, not the property.

 ~~~~
 property String MyProp
@@ -37,9 +37,9 @@
   ' This accessor doesn't throw any exceptions
 ~~~~

-Simple try/catch blocks
+Simple [**try**]/[**catch**] blocks
 -----------------------
-If you need to catch rather than declare an exception, use this syntax:
+If you need to [**catch**] rather than declare an exception, use this syntax:

 ~~~~
 try
@@ -48,7 +48,7 @@
   ' handle the exception
 ~~~~

-Multiple catch blocks for one try block
+Multiple [**catch**] blocks for one [**try**] block
 ---------------------------------------
 This sample show how to handle multiple exception types:

@@ -65,7 +65,7 @@

 Finally blocks
 --------------
-You can use a finally block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.
+You can use a [**finally**] block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.

 ~~~~
 try
@@ -76,9 +76,9 @@
   ' clean up
 ~~~~

-Try blocks with a finally block but no catch blocks
+Try blocks with a [**finally**] block but no [**catch**] blocks
 ---------------------------------------------------
-If you're declaring exceptions rather than catching them, you still might want a try block so you can have a finally block clean up.
+If you're declaring exceptions rather than catching them, you still might want a [**try**] block so you can have a [**finally**] block clean up.

 ~~~~
 command CallMe
@@ -91,4 +91,4 @@

 Possible syntax errors
 ----------------------
-If you have a try block, you must either follow it with at least one catch block or a finally block.  All compilers must catch this situation.
+If you have a [**try**] block, you must either follow it with at least one [**catch**] block or a [**finally**] block.  All compilers must catch this situation.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Sat, 08 Feb 2014 13:55:04 -0000</pubDate><guid>https://sourceforge.net8bda8ea2fac842b36b30e53fcffbb7db15e0df28</guid></item><item><title>Exceptions modified by Will Pittenger</title><link>https://sourceforge.net/p/asil/wiki/Exceptions/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-throws-clause"&gt;The throws clause&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-throws-clause-in-properties"&gt;The throws clause in properties&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#simple-trycatch-blocks"&gt;Simple try/catch blocks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#multiple-catch-blocks-for-one-try-block"&gt;Multiple catch blocks for one try block&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#finally-blocks"&gt;Finally blocks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#try-blocks-with-a-finally-block-but-no-catch-blocks"&gt;Try blocks with a finally block but no catch blocks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#possible-syntax-errors"&gt;Possible syntax errors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;Exception handling in ASIL is largely modeled after Java's exception handling.  Exceptions must derive from one of the following:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Exception base class/interface&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IThrowable&lt;/td&gt;
&lt;td&gt;All exception classes must inherit this interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exception&lt;/td&gt;
&lt;td&gt;If a property or procedure throws anything of type Exception or any class derived from Exception, it must be declared with the &lt;strong&gt;throws&lt;/strong&gt; clause or handled with a try/catch block.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Error&lt;/td&gt;
&lt;td&gt;This is an abstract class whose derived types don't need to be caught.  They are meant for  dynamic errors.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Even though exceptions of type Error don't need to be caught, all compilers should provide an option to require instances of an Error type and its derivatives to be caught.  This could be useful when the author of a exception class use Error when they should have picked Exception as their base type.&lt;/p&gt;
&lt;h2 id="the-throws-clause"&gt;The &lt;strong&gt;throws&lt;/strong&gt; clause&lt;/h2&gt;
&lt;p&gt;The &lt;span&gt;[throws]&lt;/span&gt; keyword can be applied to any procedure as shown below.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="n"&gt;DoThis&lt;/span&gt;
    &lt;span class="n"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Run&lt;/span&gt; &lt;span class="n"&gt;some&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="the-throws-clause-in-properties"&gt;The &lt;strong&gt;throws&lt;/strong&gt; clause in properties&lt;/h2&gt;
&lt;p&gt;If a property needs to throw an exception, the &lt;strong&gt;throws&lt;/strong&gt; clause should be applied to the accessor, not the property.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;property&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;MyProp&lt;/span&gt;
  &lt;span class="n"&gt;get&lt;/span&gt;
      &lt;span class="n"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;
    &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Run&lt;/span&gt; &lt;span class="n"&gt;some&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;

  &lt;span class="n"&gt;set&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;This&lt;/span&gt; &lt;span class="n"&gt;accessor&lt;/span&gt; &lt;span class="n"&gt;doesn&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;any&lt;/span&gt; &lt;span class="n"&gt;exceptions&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="simple-trycatch-blocks"&gt;Simple try/catch blocks&lt;/h2&gt;
&lt;p&gt;If you need to catch rather than declare an exception, use this syntax:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;try&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;span class="n"&gt;catch&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="multiple-catch-blocks-for-one-try-block"&gt;Multiple catch blocks for one try block&lt;/h2&gt;
&lt;p&gt;This sample show how to handle multiple exception types:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;try&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;several&lt;/span&gt; &lt;span class="n"&gt;different&lt;/span&gt; &lt;span class="n"&gt;types&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;exceptions&lt;/span&gt;
&lt;span class="n"&gt;catch&lt;/span&gt; &lt;span class="n"&gt;ExceptionA&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Handle&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;span class="n"&gt;catch&lt;/span&gt; &lt;span class="n"&gt;ExceptionB&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Handle&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;one&lt;/span&gt;
&lt;span class="n"&gt;catch&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Handle&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="n"&gt;exceptions&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="finally-blocks"&gt;Finally blocks&lt;/h2&gt;
&lt;p&gt;You can use a finally block to ensure a variable is initialized or to allow the garbage collector to deallocate a variable.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;try&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Code&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;span class="n"&gt;catch&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Handle&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;span class="n"&gt;finally&lt;/span&gt;
  &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;clean&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="try-blocks-with-a-finally-block-but-no-catch-blocks"&gt;Try blocks with a finally block but no catch blocks&lt;/h2&gt;
&lt;p&gt;If you're declaring exceptions rather than catching them, you still might want a try block so you can have a finally block clean up.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="n"&gt;CallMe&lt;/span&gt;
    &lt;span class="n"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;Exception&lt;/span&gt;
  &lt;span class="n"&gt;try&lt;/span&gt;
    &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;Do&lt;/span&gt; &lt;span class="n"&gt;something&lt;/span&gt; &lt;span class="n"&gt;that&lt;/span&gt; &lt;span class="n"&gt;might&lt;/span&gt; &lt;span class="n"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;an&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
  &lt;span class="n"&gt;finally&lt;/span&gt;
    &lt;span class="err"&gt;'&lt;/span&gt; &lt;span class="n"&gt;clean&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;but&lt;/span&gt; &lt;span class="n"&gt;don&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;exception&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="possible-syntax-errors"&gt;Possible syntax errors&lt;/h2&gt;
&lt;p&gt;If you have a try block, you must either follow it with at least one catch block or a finally block.  All compilers must catch this situation.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Will Pittenger</dc:creator><pubDate>Wed, 05 Feb 2014 10:48:49 -0000</pubDate><guid>https://sourceforge.net356fe7edc7807b1c1c3708f432ade5493c28983c</guid></item></channel></rss>