SlideShare a Scribd company logo
1 of 6
ROLE OF .NET
IN EXCEPTION
HANDLING
BY
ASRARULHAQ MAKTEDAR
ERRORS, BUGS
& EXCEPTION
Errors: These are caused by end-user of the
application.
For Ex: entering un-expected value in a textbox, say
USN.
Bugs: These are caused by the programmer.
For Ex: → making use of NULL pointer or
→ referring array-index out of bound
Exceptions: These are regarded as runtime anomalies
that are difficult to prevent.
For Ex: → trying to connect non-existing database
→ trying to open a corrupted file
→ trying to divide a number by zero
THE ROLE
OF .NET
EXCEPTION
HANDLING
Programmers have a well-defined
approach to error handling which is
common to all .NET aware languages.
Identical syntax used to throw &
catch exceptions across assemblies,
applications & machine boundaries.
Exceptions are objects that contain a
human readable description of the
problem.
The end-user can be provided with
the help-link information.
Help-link information point to a URL
that provides detailed information
regarding error at hand.
THE ATOMS
OF .NET
EXCEPTION
HANDLING
• Programming with structured exception
handling involves the use of 4 key elements:
• i) A 'type' that represents the details of the
exception that occurred.
• ii) A method that throws an instance of the
exception-class to the caller.
• iii) A block of code that will invoke the
exception-ready method (i.e. try block).
• iv) A block of code that will process the
exception (i.e. catch block).
• C# offers 4 keywords {try, catch, throw and
finally} that can be used to throw and handle
exceptions.
• The type that represents the problem at
hand is a class derived from
System.Exception.
CORE MEMBERS OF SYSTEM.EXCEPTION
TYPE
Member Meaning
Message This returns textual description of a given error. The
error-message itself is set as a constructor-parameter.
TargetSite This returns name of the method that threw the exception.
Source This returns name of the assembly that threw the exception.
HelpLink This returns a URL to a help-file which describes the error in
detail.
StackTree This returns a string that identifies the sequence of calls that
triggered the exception.
InnerException This is used to obtain information about the previous
exceptions that causes the current exception to occur.
Role of .NET in Exception Handling

More Related Content

What's hot

Exception handling
Exception handlingException handling
Exception handling
Ravi Sharda
 
Exception Handling
Exception HandlingException Handling
Exception Handling
backdoor
 
Observer & singleton pattern
Observer  & singleton patternObserver  & singleton pattern
Observer & singleton pattern
babak danyal
 

What's hot (15)

What is Exception Handling?
What is Exception Handling?What is Exception Handling?
What is Exception Handling?
 
Strange Async Code - ReaxtiveX
Strange Async Code - ReaxtiveXStrange Async Code - ReaxtiveX
Strange Async Code - ReaxtiveX
 
Custom Detectors for FindBugs (London Java Community Unconference 2)
Custom Detectors for FindBugs (London Java Community Unconference 2)Custom Detectors for FindBugs (London Java Community Unconference 2)
Custom Detectors for FindBugs (London Java Community Unconference 2)
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in python
Exception handling in pythonException handling in python
Exception handling in python
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 
Presentation on-exception-handling
Presentation on-exception-handlingPresentation on-exception-handling
Presentation on-exception-handling
 
Observer & singleton pattern
Observer  & singleton patternObserver  & singleton pattern
Observer & singleton pattern
 
Exception Handling In Java
Exception Handling In JavaException Handling In Java
Exception Handling In Java
 
Exception handling in JAVA
Exception handling in JAVAException handling in JAVA
Exception handling in JAVA
 
Exception handling
Exception handling Exception handling
Exception handling
 
Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 

Similar to Role of .NET in Exception Handling

Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8
Vince Vo
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
Chandra Sekhar Saripaka
 

Similar to Role of .NET in Exception Handling (20)

nullcon 2011 - Reversing MicroSoft patches to reveal vulnerable code
nullcon 2011 - Reversing MicroSoft patches to reveal vulnerable codenullcon 2011 - Reversing MicroSoft patches to reveal vulnerable code
nullcon 2011 - Reversing MicroSoft patches to reveal vulnerable code
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Chapter 8 - Exceptions and Assertions Edit summary
Chapter 8 - Exceptions and Assertions  Edit summaryChapter 8 - Exceptions and Assertions  Edit summary
Chapter 8 - Exceptions and Assertions Edit summary
 
Java căn bản - Chapter8
Java căn bản - Chapter8Java căn bản - Chapter8
Java căn bản - Chapter8
 
Exception
ExceptionException
Exception
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Best practices in enterprise applications
Best practices in enterprise applicationsBest practices in enterprise applications
Best practices in enterprise applications
 
Exception handling in ASP .NET
Exception handling in ASP .NETException handling in ASP .NET
Exception handling in ASP .NET
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
Templates and Exception Handling in C++
Templates and Exception Handling in C++Templates and Exception Handling in C++
Templates and Exception Handling in C++
 
CLR Exception Handing And Memory Management
CLR Exception Handing And Memory ManagementCLR Exception Handing And Memory Management
CLR Exception Handing And Memory Management
 
Exception handling in .net
Exception handling in .netException handling in .net
Exception handling in .net
 
Perfomatix - Java Coding Standards
Perfomatix - Java Coding StandardsPerfomatix - Java Coding Standards
Perfomatix - Java Coding Standards
 
Training material exceptions v1
Training material   exceptions v1Training material   exceptions v1
Training material exceptions v1
 
6-Error Handling.pptx
6-Error Handling.pptx6-Error Handling.pptx
6-Error Handling.pptx
 
Exception guidelines in c#
Exception guidelines in c#Exception guidelines in c#
Exception guidelines in c#
 
Exceptions
ExceptionsExceptions
Exceptions
 
Dot net interview questions and asnwers
Dot net interview questions and asnwersDot net interview questions and asnwers
Dot net interview questions and asnwers
 

Recently uploaded

Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
drjose256
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 

Recently uploaded (20)

Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Lab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docxLab Manual Arduino UNO Microcontrollar.docx
Lab Manual Arduino UNO Microcontrollar.docx
 
CLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference ModalCLOUD COMPUTING SERVICES - Cloud Reference Modal
CLOUD COMPUTING SERVICES - Cloud Reference Modal
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
analog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptxanalog-vs-digital-communication (concept of analog and digital).pptx
analog-vs-digital-communication (concept of analog and digital).pptx
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 

Role of .NET in Exception Handling

  • 1. ROLE OF .NET IN EXCEPTION HANDLING BY ASRARULHAQ MAKTEDAR
  • 2. ERRORS, BUGS & EXCEPTION Errors: These are caused by end-user of the application. For Ex: entering un-expected value in a textbox, say USN. Bugs: These are caused by the programmer. For Ex: → making use of NULL pointer or → referring array-index out of bound Exceptions: These are regarded as runtime anomalies that are difficult to prevent. For Ex: → trying to connect non-existing database → trying to open a corrupted file → trying to divide a number by zero
  • 3. THE ROLE OF .NET EXCEPTION HANDLING Programmers have a well-defined approach to error handling which is common to all .NET aware languages. Identical syntax used to throw & catch exceptions across assemblies, applications & machine boundaries. Exceptions are objects that contain a human readable description of the problem. The end-user can be provided with the help-link information. Help-link information point to a URL that provides detailed information regarding error at hand.
  • 4. THE ATOMS OF .NET EXCEPTION HANDLING • Programming with structured exception handling involves the use of 4 key elements: • i) A 'type' that represents the details of the exception that occurred. • ii) A method that throws an instance of the exception-class to the caller. • iii) A block of code that will invoke the exception-ready method (i.e. try block). • iv) A block of code that will process the exception (i.e. catch block). • C# offers 4 keywords {try, catch, throw and finally} that can be used to throw and handle exceptions. • The type that represents the problem at hand is a class derived from System.Exception.
  • 5. CORE MEMBERS OF SYSTEM.EXCEPTION TYPE Member Meaning Message This returns textual description of a given error. The error-message itself is set as a constructor-parameter. TargetSite This returns name of the method that threw the exception. Source This returns name of the assembly that threw the exception. HelpLink This returns a URL to a help-file which describes the error in detail. StackTree This returns a string that identifies the sequence of calls that triggered the exception. InnerException This is used to obtain information about the previous exceptions that causes the current exception to occur.