Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 1366b6f

Browse files
committed
Fix JSONDecodeError
1 parent e81c4f8 commit 1366b6f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

libfreeiot/adapters/mqtt/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ def parse_driver_select(self, data):
4242
if self.parse_driver == 'msgpack':
4343
raise OSError("Parse driver 'msgpack' under development.")
4444
elif self.parse_driver == 'json':
45-
return json.loads(data)
45+
try:
46+
return json.loads(data)
47+
except json.JSONDecodeError as e:
48+
print("Parsing failed, reason: ", e)
4649
else:
4750
raise OSError("Parse driver '" + self.parse_driver + "' under development.")

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
setup(
77
name = "libfreeiot",
8-
version = "0.9.10",
8+
version = "0.9.11",
99
description = 'A free, open-source IoT Framework',
1010
author = 'Noah Gao',
1111
author_email = 'noahgaocn@outlook.com',
1212
url = 'https://github.com/noahziheng/freeiot',
13-
download_url = 'https://github.com/noahziheng/freeiot/archive/0.9.10.tar.gz',
13+
download_url = 'https://github.com/noahziheng/freeiot/archive/0.9.11.tar.gz',
1414
packages = find_packages(),
1515
install_requires=[ # 依赖列表
1616
'Flask>=0.12.2',

0 commit comments

Comments
 (0)