FileService: exceptions must be sent explicitly for no-reply methods

FileService should not be using no-reply at all.
This commit is contained in:
David Wilson 2018-12-13 03:31:48 +00:00
parent 98696af9f8
commit 6713b90acc
1 changed files with 9 additions and 2 deletions

View File

@ -911,9 +911,16 @@ class FileService(Service):
Unregistered path, or Sender did not match requestee context. Unregistered path, or Sender did not match requestee context.
""" """
if path not in self._paths and not self._prefix_is_authorized(path): 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: 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) LOG.debug('Serving %r', path)