Raise an error rather than do an assertion