Net-informations.com
SiteMap  | About    

System level Exceptions Vs Application level Exceptions

Exceptions ?

System.Exception class is the base class for all exceptions. Exceptions are provide a structured, uniform, and type-safe way of controlling both system level and application level abnormal conditions. It can be generated by system or can be generated programmatically.

System level Exceptions

System exceptions are derive directly from a base class System.SystemException. A System level Exception is normally thrown when a nonrecoverable error has occurred, such as a database crash. These are common exceptions that are thrown by the .NET Common Language Runtime and used in almost all .Net applications.

Exception Syntax:

exceptions

Application level Exceptions

Application exceptions can be user defined exceptions thrown by the applications. If you are designing an application that needs to create its own exceptions class, you are advised to derive custom exceptions from the System.ApplicationException class. It is typically thrown when a recoverable error has occurred, such as an invalid input argument values to a business method. It will alert the client of application specific or business logic issues; they do not report system level exceptions In most cases, clients can be return to normal processing after solving application exceptions.

Exception Handling

Exceptions are the occurrence of some condition that changes the normal flow of execution. In .NET languages , Structured Exceptions handling is a fundamental part of Common Language Runtime. More about.... Exception Handling

How to throw Exception

Exception objects that describe an error are created and then thrown with the throw keyword. By using a throw statement inside a catch block, we can change the resulting exception. More about.... throw exception

How to create a custom exception

If you want users to be able to programmatically distinguish between some error conditions, you should create your own custom exceptions. It will simplify and improve the error handling and thus increase the overall code quality. More about.... Create a custom exception









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.