# Exceptions in C#

When something goes wrong at run time, C# throws an exception, and the program crashes unless code catches it. Prevent what you can check for; catch what you can't, most specific type first; and throw your own when a method can't do what it's asked.

![Cheat sheet: Exceptions in C#](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/f832b11f4238420099518cc83a4b1b53.webp)

- Category: C#
- Level: Apprentice
- Tags: catch Block (c-sharp), c-sharp, Exception (c-sharp), finally Block (c-sharp), throw (c-sharp), try Block (c-sharp)
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/exceptions-in-csharp-cheat-sheet
