Changed the type of error thrown.