Handle exceptions when setting parameters with invalid strings