Use CustomError now to more reliably determine that the error is the expected one.