Use an exception rather than assertion