HomeChallengesRepsProblemsLeaderboardTake a challenge

Catching what you can handle

An empty catch (Exception) and a leaked file handle. Handle the failure you know.

Beginner16 min on the clock5 graded checks · 100 pointsC# FoundationsPro
Graded by reading your code against the checklist below.

What you build

  • Catch the specific failure you can recover from
  • Never swallow an exception silently
  • Release the file handle whatever happens
  • Re-throw without destroying the stack trace
  • Filter or clean up rather than catching more than you meant to

Done means

A missing file is handled, everything else keeps its stack trace, and the handle is always released.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Catch the specific exception+25Exceptions you can act on
  2. Never swallow it silently+20Exceptions you can act on
  3. Release the handle whatever happens+20Exceptions you can act on
  4. Re-throw without losing the stack trace+20Exceptions you can act on
  5. Filter it, or clean up after it+15Exceptions you can act on

What it teaches

The rest of C# Foundations