def unhandledError(self, failure):
        """
        Deal with failures by instantly re-raising them for easier debugging.
        """
        self.expectedErrors -= 1
        if self.expectedErrors < 0:
            failure.raiseException()
        else:
            self.unhandledErrors.append(failure)

        Deal with failures by instantly re-raising them for easier debugging.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py