Error Handling in C# with Exceptions

Understanding and using exceptions is crucial to creating readable code that responds correctly to errors at runtime. This course will teach you how to handle errors in C# applications by throwing, catching, filtering, and customizing exceptions.
Course info
Rating
(61)
Level
Intermediate
Updated
Aug 6, 2018
Duration
1h 37m
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
(61)
Level
Intermediate
Updated
Aug 6, 2018
Duration
1h 37m
Description

At the core of handling errors in C# code is a thorough knowledge of exception handling. In this course, Error Handling in C# with Exceptions, you’ll learn how to write code that can detect and respond to runtime errors. First, you’ll learn why exceptions are used to represent errors in C# and how they are organized into class hierarchies. Next, you’ll explore how to throw, catch, filter, rethrow, and wrap exceptions. Finally, you’ll discover how to define, throw, and catch your own customized exception classes and also write unit tests for exception throwing code. When you’re finished with this course, you’ll have a thorough knowledge of C# exceptions that will help you to create production-ready C# applications that detect and respond to runtime errors.

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
C# Tips and Traps
Intermediate
4h 8m
Dec 13, 2019
Working with Nulls in C#
Intermediate
2h 9m
Aug 19, 2019
More courses by Jason Roberts
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone, my name's Jason Roberts. Welcome to my course, Error Handling in C# with Exceptions. I'm a freelance developer and author. In this course, you're going to learn what exceptions are, and how to use them to handle errors in your C# applications. Some of the major topics that we'll cover in this course include the exception class hierarchy and useful standard exception types, different ways to throw and handle exceptions, how to create custom exceptions, and how to unit test exception throwing code. By the end of this course, you'll understand how C# exceptions work, and how to use them to manage errors in your C# solutions. Before beginning the course, it's recommended that you have at least a basic understanding of C#. I hope you'll join me on this journey with the Error Handling in C# with Exceptions course at Pluralsight.