Factor exceptions in their own module