How to use the gidgethub.GitHubException function in gidgethub

To help you get started, we’ve selected a few gidgethub 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 sanitizers / octomachinery / octomachinery / github / errors / __init__.py View on Github external
"""Exceptions collection related to interactions with GitHub."""

import attr
from gidgethub import GitHubException

# pylint: disable=relative-beyond-top-level
from ..models.action_outcomes import ActionOutcome


class GitHubError(GitHubException):
    """Generic GitHub-related error."""


@attr.dataclass
class GitHubActionError(GitHubError):
    """Generic GitHub-related error."""

    _outcome: ActionOutcome

    def terminate_action(self):
        """Terminate current process using corresponding return code."""
        self._outcome.raise_it()
github bioconda / bioconda-utils / bioconda_utils / githubhandler.py View on Github external
async def iter_pr_commits(self, number: int):
        """Create iterator over commits in a PR"""
        var_data = copy(self.var_default)
        var_data['number'] = str(number)
        try:
            async for item in self.api.getiter(self.PULL_COMMITS, var_data):
                yield item
        except gidgethub.GitHubException:
            return