# Exception Handling

Using try, catch, and related statements to respond to failures.

## What is **Exception Handling** in C#?

**Exception Handling** — Using try, catch, and related statements to respond to failures.

```csharp
class OrderReader
{
    int ReadQuantity(string text)
    {
        try
        {
            return int.Parse(text);
        }
        catch (FormatException)
        {
            return 0;
        }
    }
}
```

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: September 27, 2026

## In other subjects

- [Exception Handling in Java](https://www.ask-codey.com/glossary/exception-handling)

Source: https://www.ask-codey.com/glossary/exception-handling-c-sharp
