use exceptions rather than assertions since the code is non time critical