Raise intelligent error on invalid argument