def _ebBadAuth(self, reason):
        """
        The final errback in the authentication chain.  If the reason is
        error.IgnoreAuthentication, we simply return; the authentication
        method has sent its own response.  Otherwise, send a failure message
        and (if the method is not 'none') increment the number of login
        attempts.

        @type reason: L{twisted.python.failure.Failure}
        """
        if reason.check(error.IgnoreAuthentication):
            return
        if self.method != b'none':
            log.msg('%r failed auth %r' % (self.user, self.method))
            if reason.check(UnauthorizedLogin):
                log.msg('unauthorized login: %s' % reason.getErrorMessage())
            elif reason.check(error.ConchError):
                log.msg('reason: %s' % reason.getErrorMessage())
            else:
                log.msg(reason.getTraceback())
            self.loginAttempts += 1
            if self.loginAttempts > self.attemptsBeforeDisconnect:
                self.transport.sendDisconnect(
                        transport.DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE,
                        b'too many bad auths')
                return
        self.transport.sendPacket(
                MSG_USERAUTH_FAILURE,
                NS(b','.join(self.supportedAuthentications)) + b'\x00')

        The final errback in the authentication chain.  If the reason is
        error.IgnoreAuthentication, we simply return; the authentication
        method has sent its own response.  Otherwise, send a failure message
        and (if the method is not 'none') increment the number of login
        attempts.

        @type reason: L{twisted.python.failure.Failure}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/userauth.py