From 6713b90acca4fd5a4140b877d82eb2f576aa11e5 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 13 Dec 2018 03:31:48 +0000 Subject: [PATCH] FileService: exceptions must be sent explicitly for no-reply methods FileService should not be using no-reply at all. --- mitogen/service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mitogen/service.py b/mitogen/service.py index 073c9d6f..097ec09d 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -911,9 +911,16 @@ class FileService(Service): Unregistered path, or Sender did not match requestee context. """ if path not in self._paths and not self._prefix_is_authorized(path): - raise Error(self.unregistered_msg % (path,)) + msg.reply(mitogen.core.CallError( + Error(self.unregistered_msg % (path,)) + )) + return + if msg.src_id != sender.context.context_id: - raise Error(self.context_mismatch_msg) + msg.reply(mitogen.core.CallError( + Error(self.context_mismatch_msg) + )) + return LOG.debug('Serving %r', path)