ArgumentError is meant for command line arguments that receive bad input, not library functions need to validate their input.  Use ValueError or an assert statement for that.