Skip to main content
Glama
exceptions.py1.45 kB
"""Minimal subset of exceptions used in the tests. The real project depends on the `python-gitlab` package which provides a rich set of exception classes. The execution environment for the kata does not have that dependency installed, therefore importing from :mod:`gitlab.exceptions` would fail. The tests only require a handful of exception types, so we provide light‑weight stand‑ins that mimic the real hierarchy sufficiently for testing purposes. """ class GitlabError(Exception): """Base class for all GitLab related errors.""" class GitlabHttpError(GitlabError): """HTTP level error returned by the GitLab API.""" class GitlabAuthenticationError(GitlabHttpError): """Raised when authentication with the GitLab API fails.""" class GitlabGetError(GitlabHttpError): """Raised for errors fetching resources from the API.""" def __init__(self, *args, response_code: int | None = None, **kwargs): super().__init__(*args) # Tests access ``response_code`` to differentiate error types. self.response_code = response_code class GitlabListError(GitlabHttpError): """Raised when listing resources fails.""" class GitlabCreateError(GitlabHttpError): """Raised when creating a resource fails.""" class GitlabUpdateError(GitlabHttpError): """Raised when updating a resource fails.""" class GitlabDeleteError(GitlabHttpError): """Raised when deleting a resource fails."""

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server