Skip to content

Commit

Permalink
feat(shortcuts): Exceptions for VCS matches
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Aug 20, 2023
1 parent 7d024b9 commit f001aae
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/libvcs/_internal/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,31 @@
import typing as t
from typing import Union

from libvcs import GitSync, HgSync, SvnSync
from libvcs import GitSync, HgSync, SvnSync, exc
from libvcs._internal.run import ProgressCallbackProtocol
from libvcs._internal.types import StrPath, VCSLiteral
from libvcs.exc import InvalidVCS, LibVCSException
from libvcs.exc import InvalidVCS
from libvcs.url import registry as url_tools

if t.TYPE_CHECKING:
from typing_extensions import TypeGuard


class VCSNoMatchFoundForUrl(exc.LibVCSException):
def __init__(self, url: str, *args: object):
return super().__init__(f"No VCS found for url: {url}")


class VCSMultipleMatchFoundForUrl(exc.LibVCSException):
def __init__(self, url: str, *args: object):
return super().__init__(f"Multiple VCS found for url: {url}")


class VCSNotSupported(exc.LibVCSException):
def __init__(self, url: str, vcs: str, *args: object):
return super().__init__(f"VCS '{vcs}' not supported, based on URL: {url}")


@t.overload
def create_project(
*,
Expand Down

0 comments on commit f001aae

Please sign in to comment.