How to use the aiogithubapi.AIOGitHubAPIAuthenticationException function in aiogithubapi

To help you get started, we’ve selected a few aiogithubapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hacs / integration / custom_components / hacs / config_flow.py View on Github external
async def _test_token(self, token):
        """Return true if token is valid."""
        try:
            session = aiohttp_client.async_get_clientsession(self.hass)
            await get_repository(session, token, "hacs/org")
            return True
        except (
            AIOGitHubAPIException,
            AIOGitHubAPIAuthenticationException,
        ) as exception:
            _LOGGER.error(exception)
        return False