Instead of an `errorIf int`, why not pass in a function?