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

FileService should not be using no-reply at all.
issue510
David Wilson 6 years ago
parent 98696af9f8
commit 6713b90acc

@ -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)

Loading…
Cancel
Save