Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference Between Application Exception and System Exception

Tags:

.net

exception

I want to know the difference Between System.ApplicationException and System.Exception.

Can anyone explain

like image 499
Bhaskar Avatar asked May 11 '09 13:05

Bhaskar


People also ask

What is an application exception?

ApplicationException is thrown by a user program, not by the common language runtime. If you are designing an application that needs to create its own exceptions, derive from the ApplicationException class. ApplicationException extends Exception, but does not add new functionality.

What is the difference between system exception and business exception?

A Business Exception occurs when a bot encounters a problem with the process's business logic and is unable to complete execution. However, if the bot is tripped up by a technical problem, it is said to have encountered an Application Exception or a System Exception.

What is a system exception?

SystemException is thrown by the common language runtime when errors occur that are nonfatal and recoverable by user programs. These errors result from failed runtime check (such as an array out-of-bound error), and can occur during the execution of any method.


1 Answers

Originally they were intended to separate BCL defined and user defined Exceptions. ApplicationException was meant to be the base class for all user defined exceptions. The idea was it would give you a clean way to differintiate between framework exceptions and custom exceptions.

Unfortunately this policy was not enforced from the start and as a result there are many contradictions to this rule in the BCL. The current recomendation is not to inherit from these exceptions.

Here's a nice blog entry on the subject:

  • http://blogs.msdn.com/kcwalina/archive/2006/06/23/644822.aspx
like image 197
JaredPar Avatar answered Oct 04 '22 14:10

JaredPar