Using assert would be better here instead of the `if:` `raise` block.