diff --git a/libfreeiot/adapters/mqtt/main.py b/libfreeiot/adapters/mqtt/main.py index 23e4441..805fd30 100644 --- a/libfreeiot/adapters/mqtt/main.py +++ b/libfreeiot/adapters/mqtt/main.py @@ -42,6 +42,9 @@ def parse_driver_select(self, data): if self.parse_driver == 'msgpack': raise OSError("Parse driver 'msgpack' under development.") elif self.parse_driver == 'json': - return json.loads(data) + try: + return json.loads(data) + except json.JSONDecodeError as e: + print("Parsing failed, reason: ", e) else: raise OSError("Parse driver '" + self.parse_driver + "' under development.") diff --git a/setup.py b/setup.py index 519bb17..1747456 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ setup( name = "libfreeiot", - version = "0.9.10", + version = "0.9.11", description = 'A free, open-source IoT Framework', author = 'Noah Gao', author_email = 'noahgaocn@outlook.com', url = 'https://github.com/noahziheng/freeiot', - download_url = 'https://github.com/noahziheng/freeiot/archive/0.9.10.tar.gz', + download_url = 'https://github.com/noahziheng/freeiot/archive/0.9.11.tar.gz', packages = find_packages(), install_requires=[ # 依赖列表 'Flask>=0.12.2',