[UPDATE] raising an error for invalid grid params