Exception Handling in C#

Understanding and using exceptions is vital if you want to create maintainable code that responds correctly to runtime errors. This course will teach you how to handle errors in C# applications by throwing, catching, and customizing exceptions.
Course info
Rating
(35)
Level
Intermediate
Updated
Mar 22, 2021
Duration
1h 44m
Table of contents
Course Overview
Understanding the Importance of Error Handling
Understanding the Exception Class Hierarchy
Getting Started with Exceptions
Catching, Throwing, and Rethrowing Exceptions
Creating and Using Custom Exceptions
Writing Automated Tests for Exception Throwing Code
Description
Course info
Rating
(35)
Level
Intermediate
Updated
Mar 22, 2021
Duration
1h 44m
Your 10-day individual free trial includes:

Expert-led courses

Keep up with the pace of change with thousands of expert-led, in-depth courses.
Description

Missing or incorrectly implemented error handling code can lead to data corruption, unnecessary crashes, annoyed end-users, out-of-hours support calls, and hard to maintain code. In this course, Exception Handling in C#, you’ll gain the ability to correctly handle runtime errors in your C# applications. First, you’ll explore what exceptions are and why we use them. Next, you’ll discover how to respond to errors that occur in your applications at runtime. Finally, you’ll learn how to throw exceptions in your own code and even how to define your own custom exception classes. When you’re finished with this course, you’ll have the skills and knowledge of C# exception handling needed to handle runtime errors in your C# applications.

About the author
About the author

With over 15 years experience, Jason Roberts is a Microsoft .NET MVP, freelance developer, and author.

More from the author
Working with Nulls in C#
Advanced
2h 31m
Aug 13, 2021
Working with Files and Streams in C#
Intermediate
3h 25m
Jun 2, 2021
More courses by Jason Roberts
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi, everyone. My name is Jason Roberts and welcome to my course, Exception Handling in C#. I'm a freelance developer and author. Exceptions in C# give you a structured way to respond to runtime errors in your .NET applications. Without them, you have no way of preventing your application from crashing, no way to perform your own logging when things go wrong, and no way to try and correct errors before your users lose all of their work. In this course, we're going to learn how to manage and respond to errors that occur when your program is running. Some of the major topics that we'll cover include why we use exceptions and not error codes in C#, where exception classes come from, how to respond to runtime errors, how to signal your own runtime error conditions, and even how to define your own custom exception classes. By the end of this course, you'll know how to respond to and manage runtime errors in your C# applications in a structured and readable way Before beginning the course, you should be familiar with basic C# syntax. I hope you'll join me on this journey to learn how to handle errors in your C# applications with the Exception Handling in C# course at Pluralsight.