From the course: .NET Fundamentals: Concepts, APIs, and Libraries in the .NET Framework
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Handling exceptions in .NET - .NET Tutorial
From the course: .NET Fundamentals: Concepts, APIs, and Libraries in the .NET Framework
Handling exceptions in .NET
- [Instructor] All frameworks provide a way to signal failure to the calling code. For example some languages return error codes when something goes wrong. Other systems might signal success in a function call by returning the value that you requested and signal failure by returning a negative number or some other special value .net uses exceptions for this purpose because .net is a strong type system. You won't be surprised to learn that .net has exception classes. They encapsulate the information needed by the CLR to handle the runtime error. The .net framework provides a rich set of exception classes that are used to represent different types of errors that can occur during the execution of a program. For example, here are some of the exception classes for working with database errors and the first thing you want to note is that by convention all exceptions in .net end with the word exception. So the one you see at the…
Contents
-
-
-
-
(Locked)
The Common Type System (CTS)7m 41s
-
(Locked)
Namespaces and assemblies7m 5s
-
(Locked)
Interfaces5m 58s
-
(Locked)
Generics7m 22s
-
(Locked)
Delegates and Lambda expressions7m 51s
-
(Locked)
Reflection and attributes8m 32s
-
(Locked)
Nullable value types6m 39s
-
(Locked)
Arrays and collections6m 24s
-
(Locked)
Events and event handlers6m 42s
-
(Locked)
Handling exceptions in .NET8m 52s
-
(Locked)
Strings and Chars5m 50s
-
(Locked)
C# records and .NET3m 54s
-
(Locked)
Auto memory management with garbage collection9m 56s
-
(Locked)
Command line and the SDK5m 56s
-
(Locked)
Publishing applications2m 7s
-
(Locked)
-