Exception handling in asp.net Part 69



Exception handling in asp.net Part 69

Exception handling in asp.net   Part 69

Text version of the video
http://csharp-video-tutorials.blogspot.com/2012/12/exception-handling-in-aspnet-part-69.html

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.
https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1

Slides
http://csharp-video-tutorials.blogspot.com/2013/08/part-69-exception-handling-in-aspnet.html

All ASP .NET Text Articles
http://csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

All ASP .NET Slides
http://csharp-video-tutorials.blogspot.com/p/aspnet-slides.html

All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists

Exceptions are unforeseen errors that happen within the logic of an application. For example, when reading a file, a number of exception conditions can occur.
1. The file might not exist
2. You may not have permissions to access the file

When an exception occurs and if it is not handled, then, that exception is called as an, unhandled exception. An unhandled exception is displayed to the user using an “yellow screen of death”. Displaying the screen of death is bad for 2 reasons
1. The error messages are cryptic and may not make any sense to the end user
2. The exception information may be useful for a hacker, to hack into your application

Exception handling using – try-catch
try – Wrap the code in a try block that could possibly cause an exception. If a statement in the try block causes an exception, the control will be immediately transferred to the catch block.

catch – catches the exception and tries to correct the error and/or handles the exception

finally – Used to free resources. Finally block is guaranteed to execute irrespective of whether an exception has occurred or not

throw – Used to raise an exception

The base class for all exceptions is the Exception class. Specific exceptions should be caught, before catching the general parent exception.

In this session we discussed about handling errors using try/catch blocks. In a later video session we will discuss about, how exceptions are generally handled in a real time asp.net application.

Comments are closed.