diff --git a/mitogen/service.py b/mitogen/service.py index 3713bdea..ffb7308e 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -873,7 +873,14 @@ class FileService(Service): raise Error(self.context_mismatch_msg) LOG.debug('Serving %r', path) - fp = open(path, 'rb', self.IO_SIZE) + try: + fp = open(path, 'rb', self.IO_SIZE) + except IOError: + msg.reply(mitogen.core.CallError( + sys.exc_info()[1] + )) + return + # Response must arrive first so requestee can begin receive loop, # otherwise first ack won't arrive until all pending chunks were # delivered. In that case max BDP would always be 128KiB, aka. max