﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » StrataFrame Exceptions vs .NET Exceptions</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 22 May 2026 11:36:08 GMT</lastBuildDate><ttl>20</ttl><item><title>StrataFrame Exceptions vs .NET Exceptions</title><link>http://forum.strataframe.net/FindPost31891.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;I'm a begginer StrataFrame developer and am interested in what benefit I would get out of using the StrataFrame Exception class over just the base .NET exception class.&lt;br/&gt;&lt;br/&gt;I have a console app that has a very basic try/catch error handler where an exception is entered into the Windows EventLog like this:&lt;br/&gt;&lt;br/&gt;&lt;blockquote style="margin-right: 0px;" dir="ltr"&gt;l_ovCalLog.WriteEntry(l_oException.ToString(), EventLogEntryType.Error)&lt;br/&gt;&lt;br/&gt;&lt;/blockquote&gt;Which is fine for what I'm using it for, but I'm interested in what StrataFrame tools/classes I can use for my benefit&amp;nbsp;outside of a normal Winforms app.</description><pubDate>Fri, 01 Mar 2013 10:46:36 GMT</pubDate><dc:creator>William Fields</dc:creator></item><item><title>RE: StrataFrame Exceptions vs .NET Exceptions</title><link>http://forum.strataframe.net/FindPost31894.aspx</link><description>You can throw any exception you want. &amp;nbsp;According to Microsoft's guidelines, they used to say that you should base any exceptions you create off of ApplicationException. &amp;nbsp;It's the base class for almost every exception in the .NET Framework. &amp;nbsp;But they have now changed their mind:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;About halfway down this article:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/vstudio/seyhszts(v=vs.100).aspx"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/vstudio/seyhszts(v=vs.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/vstudio/seyhszts(v=vs.100).aspx&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;div&gt;&lt;span style="color: rgb(102, 102, 102); font-family: 'Segoe UI', Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"&gt;[quote]For most applications, derive custom exceptions from the&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102); font-family: 'Segoe UI', Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/vstudio/system.exception(v=vs.100).aspx" style="text-decoration: none; color: rgb(19, 130, 206);"&gt;Exception&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102); font-family: 'Segoe UI', Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"&gt;&amp;nbsp;class. It was originally thought that custom exceptions should derive from the&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102); font-family: 'Segoe UI', Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/vstudio/system.applicationexception(v=vs.100).aspx" style="text-decoration: none; color: rgb(19, 130, 206);"&gt;ApplicationException&lt;/a&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102); font-family: 'Segoe UI', Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"&gt;&amp;nbsp;class; however in practice this has not been found to add significant value.[/quote]&lt;/span&gt;&lt;div&gt;&lt;div&gt;You can throw StrataFrameExceptions if you want. &amp;nbsp;We don't add any extra features to the StrataFrameException class. &amp;nbsp;We created it and the BusinessLayerException and DataLayerException classes in order to wrap common exceptions and give more information that a developer can use to solve the problem. &amp;nbsp;Most of it is configuration-related stuff. &amp;nbsp;For instance, if you try to run a query without first adding a DataSource to the DataBasics.DataSources collection, we don't just throw a KeyNotFoundException from .NET, we wrap it and say "hey, you need to add a data source before you try this."&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Now, the StrataFrameException class doesn't add anything extra, but we have some exception helpers that are useful. &amp;nbsp;We have the MicroFour.StrataFrame.Tools.Exceptions class. &amp;nbsp;The most useful method on it is the CreateExceptionDetails() method which returns a string that lists all of the inner exceptions and a combined stack trace of all of the inner exceptions. &amp;nbsp;It also includes extra information on common exceptions like TypeLoadExceptions and such that have extra details in there internal IList stuff.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;We also have the MicroFour.StrataFrame.Application.ApplicationErrorDialog which shows an exception using the CreateExceptionDetails() method mentioned above in a nice, red box.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;The default project template also adds handlers to AppDomain.Current.UnhandledException to trap exceptions that are, you guessed it, unhandled.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Hope that helps.</description><pubDate>Fri, 01 Mar 2013 10:46:36 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>