Exception handling syntax: Difference between revisions

Content deleted Content added
[[BASIC]]: <source>
[[Csharp|C#]]: <source>
Line 54:
 
=== [[Csharp|C#]] ===
<source lang=csharp>
public static void Main()
{
try
{try
try{
// Code that could throw an exception
}
catch(System.Net.WebException exp)
{
//Process a WebException
}
}
catch(System.Exception)
{
//Process a System level CLR exception, that is not a System.Net.WebException
//since the exception has not been given an identifier it cannot be referenced
}
catch
{
//Process a non-CLR exception
}
finally
{
// (optional) code that will *always* execute
}
}
</source>
 
=== [[C++]] ===