Skip to content

Commit 1b70bbf

Browse files
committed
Changes in model
1 parent 58da386 commit 1b70bbf

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

reportportal_client/model/response.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ def __init__(self, raw):
1515
def id(self):
1616
try:
1717
return json.loads(self.raw)["id"]
18-
except KeyError:
19-
print("{0} object has no attribute 'id'".format(self.raw))
20-
return None
18+
except KeyError as error:
19+
error.message += "Raw: {0}".format(self.raw)
20+
raise
2121

2222
def as_dict(self):
23-
try:
24-
return {"id": self.id}
25-
except KeyError:
26-
return json.loads(self.raw)
23+
return {"id": self.id}
2724

2825

2926
class OperationCompletionRS(RS):
@@ -34,12 +31,9 @@ def __init__(self, raw):
3431
def msg(self):
3532
try:
3633
return json.loads(self.raw)["msg"]
37-
except KeyError:
38-
print("{0} object has no attribute 'msg'".format(self.raw))
39-
return None
34+
except KeyError as error:
35+
error.message += "Raw: {0}".format(self.raw)
36+
raise
4037

4138
def as_dict(self):
42-
try:
43-
return {"msg": json.loads(self.raw)["msg"]}
44-
except KeyError:
45-
return json.loads(self.raw)
39+
return {"msg": self.msg}

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
setup(
44
name='reportportal-client',
55
packages=find_packages(),
6-
version='2.5.1',
6+
version='2.5.2',
77
description='Python client for ReportPortal',
88
author='Artsiom Tkachou',
99
author_email='[email protected]',
1010
url='https://github.com/reportportal/client-Python',
11-
download_url='https://github.com/reportportal/client-Python/tarball/2.5.1',
11+
download_url='https://github.com/reportportal/client-Python/tarball/2.5.2',
1212
keywords=['testing', 'reporting', 'reportportal'],
1313
classifiers=[],
1414
install_requires=["requests"],

0 commit comments

Comments
 (0)