Hacker News new | ask | show | jobs
by gwbas1c 1334 days ago
> If you can write a unit test that makes your code throw UnreachableException, you almost certainly should be throwing a different exception.

ArgumentNullException, InvalidOperationException... There's plenty that have been around since the beginning.

What's more important, that I didn't see in the first two examples, are useful error messages.

1 comments

`ArgumentNullException` was my first idea too. I would and did use it for this kind of purpose.