Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
73cc8578
Commit
73cc8578
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-777
: processed review comments
parent
e01cd5a8
No related branches found
No related tags found
1 merge request
!12
Lofar release 4 0 - merge back release patches and features to master
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/Messaging/python/messaging/rpc.py
+8
-4
8 additions, 4 deletions
LCS/Messaging/python/messaging/rpc.py
with
8 additions
and
4 deletions
LCS/Messaging/python/messaging/rpc.py
+
8
−
4
View file @
73cc8578
...
...
@@ -193,6 +193,9 @@ class ServiceMessageHandler(UsingToBusMixin, AbstractMessageHandler):
if
not
isinstance
(
msg
,
RequestMessage
):
raise
ValueError
(
"
%s: Ignoring non-RequestMessage: %s
"
%
(
self
.
__class__
.
__name__
,
msg
))
# handle the RequestMessage via the _service_handle_message
# create a ReplyMessage based on the success (exception or not)
# use the reply_msg.handled_successfully as state variable for error handling below...
try
:
result
=
self
.
_service_handle_message
(
msg
)
reply_msg
=
ReplyMessage
(
content
=
result
,
...
...
@@ -206,11 +209,12 @@ class ServiceMessageHandler(UsingToBusMixin, AbstractMessageHandler):
subject
=
msg
.
reply_to
,
error_message
=
str
(
e
))
try
:
#
try
to send back the reply, might raise on itself, which is ok, it's handled by the buslistener.
self
.
send
(
reply_msg
)
except
Exception
as
e
:
logger
.
warning
(
e
)
# send was ok, no exception
# now check reply_msg.handled_successfully state variable,
# and raise if False. The exception is then handled by the buslistener.
if
not
reply_msg
.
handled_successfully
:
raise
Exception
(
reply_msg
.
error_message
)
...
...
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