This happens if --json is used and a CommandError is raised, so will affect other commands too where --json is used.
This happens in the print_json_status method.
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
"""
def default(self, obj):
- if isinstance(obj, (Decimal, Dn, MessageElement)):
+ if isinstance(obj, (Decimal, Dn, Exception, MessageElement)):
return str(obj)
if isinstance(obj, Result):
return obj.msgs