Skip to content

Commit

Permalink
Fix JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
noahziheng committed Apr 13, 2018
1 parent e81c4f8 commit 1366b6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion libfreeiot/adapters/mqtt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '[email protected]',
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',
Expand Down

0 comments on commit 1366b6f

Please sign in to comment.