From a786fef06639da439f9edd367db36388dc1c2658 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 2 Jan 2013 22:03:02 +0100 Subject: little cleanup, improved handling of custom exceptions via api --- module/remote/json_converter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/remote/json_converter.py') diff --git a/module/remote/json_converter.py b/module/remote/json_converter.py index 76a0d5935..ad7645ccc 100644 --- a/module/remote/json_converter.py +++ b/module/remote/json_converter.py @@ -9,12 +9,13 @@ except ImportError: import ttypes from ttypes import BaseObject +from ttypes import ExceptionObject # json encoder that accepts TBase objects class BaseEncoder(json.JSONEncoder): def default(self, o): - if isinstance(o, BaseObject): + if isinstance(o, BaseObject) or isinstance(o, ExceptionObject): ret = {"@class" : o.__class__.__name__} for att in o.__slots__: ret[att] = getattr(o, att) -- cgit v1.2.3