def noPage(self, reason):
        """
        Close the storage file and errback the waiting L{Deferred} with the
        given reason.
        """
        if self.waiting:
            self.waiting = 0
            if self.file:
                try:
                    self.file.close()
                except:
                    self._log.failure("Error closing HTTPDownloader file")
            self.deferred.errback(reason)

        Close the storage file and errback the waiting L{Deferred} with the
        given reason.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/client.py