Home > Backend Development > C++ > Difference between system level exceptions and application level exceptions.

Difference between system level exceptions and application level exceptions.

王林
Release: 2023-09-02 20:45:03
forward
1256 people have browsed it

Difference between system level exceptions and application level exceptions.

As we all know, exceptions refer to interruptions in the flow of a program or application. Such unwanted events are called exceptions and usually indicate an error in the code. Basically, especially in C# language, exceptions can be system level exceptions or application level exceptions. So on this basis

Application level exception
#Sr. No. Key System level exception
1 Derived System exceptions are derived from the base class System.SystemException, which is itself a derived class On the other hand, application-level exceptions are derived from the base class System.ApplicationException, which is itself a derived class. Derived class
2 Occurrence Generally, whenever a system exception occurs and some unrecoverable or fatal error is encountered, such as a database crash , binding errors, etc. In the case of application-level exceptions, you will encounter some recoverable errors, such as input data type errors, arithmetic exceptions, etc.
3 Handling Because errors in system-level exception cases are fatal, there is no such type of exception handling or method of preventing exceptions. On the other hand, since application-level exceptions are usually handled at the code level using try-catch blocks. If the code does not throw an exception in the try and catch block, then it propagates to the page level where the Page_Error routine can be used to handle the exception
4 Custom When a system-level exception occurs, exception customization is not supported. On the other hand, we can define and declare custom application level exceptions.
5 Generate As mentioned above, system-level exceptions are thrown by the .NET common language runtime and are used in almost all .Net applications used in the program. On the other hand, when a recoverable error occurs, such as a business method with an invalid input parameter value, an application-level exception is thrown. It will raise application-specific alerts or business logic issues to clients.

The above is the detailed content of Difference between system level exceptions and application level exceptions.. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template