better error message
This commit is contained in:
parent
baff78069c
commit
3c527da97b
|
@ -44,10 +44,7 @@ class Common:
|
|||
verify=False)
|
||||
code = req.status_code
|
||||
if code != 200:
|
||||
err = self.get_error_from_http(req)
|
||||
raise Exception('unable to load url ({}): {} ({})'.format(url,
|
||||
err,
|
||||
code))
|
||||
raise Exception(self.get_error_from_http(req))
|
||||
json = req.json()
|
||||
return config_type(json)
|
||||
|
||||
|
|
|
@ -17,11 +17,8 @@ class ConfigAPI(Config):
|
|||
if isinstance(payload['value'], list):
|
||||
payload['value_multi'] = payload['value']
|
||||
del payload['value']
|
||||
ret = send_data(self.message,
|
||||
payload)
|
||||
if ret['status'] == 'error':
|
||||
msg = _("cannot modify variable {} : {}").format(payload['name'],ret['message'])
|
||||
raise Exception(msg)
|
||||
send_data(self.message,
|
||||
payload)
|
||||
|
||||
self.updates = []
|
||||
|
||||
|
@ -57,6 +54,7 @@ class Configuration(Common):
|
|||
try:
|
||||
index = parameters.index('--sessionid')
|
||||
except ValueError:
|
||||
# FIXME not working ...
|
||||
tiramisu_config = self.remote_json_to_config(ConfigAPI)
|
||||
parser = TiramisuCmdlineParser(tiramisu_config,
|
||||
self.prog,
|
||||
|
|
Loading…
Reference in New Issue