'Close the storage file and errback the waiting L{Deferred} with the
given reason.'

def noPage(self, reason):

    if self.waiting:
        self.waiting = 0
        if self.file:
            try:
                self.file.close()
            except:
                log.err(None, 'Error    closing    HTTPDownloader    file')
        self.deferred.errback(reason)
