ConfigError, not PropertiesOptionError if cannot access to option in carry_out_calculation

This commit is contained in:
Emmanuel Garette 2013-06-12 17:07:29 +02:00
parent 0d114001f4
commit 9c47eb32d5
1 changed files with 6 additions and 3 deletions

View File

@ -53,16 +53,19 @@ def carry_out_calculation(name, config, callback, callback_params, index=None):
except PropertiesOptionError, err: except PropertiesOptionError, err:
if check_disabled: if check_disabled:
continue continue
raise PropertiesOptionError(err, err.proptype) raise ConfigError(_('unable to carry out a calculation, '
'option {0} has properties: {1} for: '
'{2}').format(opt._name, err.proptype,
name))
is_multi = opt.impl_is_multi() is_multi = opt.impl_is_multi()
if is_multi: if is_multi:
if opt_value is not None: if opt_value is not None:
len_value = len(opt_value) len_value = len(opt_value)
if len_multi != 0 and len_multi != len_value: if len_multi != 0 and len_multi != len_value:
raise ConfigError('unable to carry out a ' raise ConfigError(_('unable to carry out a '
'calculation, option values with' 'calculation, option values with'
' multi types must have same ' ' multi types must have same '
'length for: ' + name) 'length for: {0}').format(name))
len_multi = len_value len_multi = len_value
one_is_multi = True one_is_multi = True
tcparams.setdefault(key, []).append((opt_value, is_multi)) tcparams.setdefault(key, []).append((opt_value, is_multi))