How to design exception hierarchies
I proudly copied the head line from the orginial article since I couldn’t make it any better.
The link below leads to a lengthy, but still to the point, text about how to design your exceptions. The examples are from dotnet but the design can be used in, say, Java too.
( I used to have a design pattern for exceptions but I gave it up some time ago and thankfully never blogged about it. )