Don't let a JSON error get lost in cascading errors.

If a JSON decoding error was found we were still trying to call the
XML-RPC function, losing the original error.

https://fedorahosted.org/freeipa/ticket/1322
This commit is contained in:
Rob Crittenden 2011-06-14 17:51:12 -04:00 committed by Martin Kosek
parent 613804083d
commit 23c5af218f

View File

@ -227,11 +227,12 @@ class WSGIExecutioner(Executioner):
error = InternalError()
finally:
os.environ['LANG'] = lang
params = self.Command[name].args_options_2_params(*args, **options)
if error:
self.info('%s: %s(%s): %s', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)), e.__class__.__name__)
else:
self.info('%s: %s(%s): SUCCESS', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)))
if error is None:
params = self.Command[name].args_options_2_params(*args, **options)
if error:
self.info('%s: %s(%s): %s', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)), e.__class__.__name__)
else:
self.info('%s: %s(%s): SUCCESS', context.principal, name, ', '.join(self.Command[name]._repr_iter(**params)))
return self.marshal(result, error, _id)
def simple_unmarshal(self, environ):