Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
97e8fcb1
Commit
97e8fcb1
authored
7 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
Improve handling of lists as rpc reply
parent
9a72a1c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
beemgrapheneapi/graphenerpc.py
+8
-6
8 additions, 6 deletions
beemgrapheneapi/graphenerpc.py
with
8 additions
and
6 deletions
beemgrapheneapi/graphenerpc.py
+
8
−
6
View file @
97e8fcb1
...
...
@@ -270,20 +270,22 @@ class GrapheneRPC(object):
if
isinstance
(
ret
,
list
):
ret_list
=
[]
for
r
in
ret
:
if
'
error
'
in
ret
:
if
'
detail
'
in
ret
[
'
error
'
]:
raise
RPCError
(
ret
[
'
error
'
][
'
detail
'
])
else
:
raise
RPCError
(
ret
[
'
error
'
][
'
message
'
])
if
isinstance
(
r
,
dict
)
and
'
error
'
in
r
:
if
'
detail
'
in
r
[
'
error
'
]:
raise
RPCError
(
r
[
'
error
'
][
'
detail
'
])
else
:
raise
RPCError
(
r
[
'
error
'
][
'
message
'
])
elif
isinstance
(
r
,
dict
)
and
"
result
"
in
r
:
ret_list
.
append
(
r
[
"
result
"
])
else
:
ret_list
.
append
(
r
)
self
.
error_cnt_call
=
0
return
ret_list
elif
isinstance
(
ret
,
dict
)
and
"
result
"
in
ret
:
self
.
error_cnt_call
=
0
return
ret
[
"
result
"
]
elif
isinstance
(
ret
,
int
):
raise
ValueError
(
"
Client returned invalid format. Expected JSON!
"
)
raise
ValueError
(
"
Client returned invalid format. Expected JSON!
Output: %s
"
%
(
str
(
ret
))
)
else
:
self
.
error_cnt_call
=
0
return
ret
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment