# HG changeset patch # User Serhii Ilin # Date 2024-09-10 12:07:44 # Node ID 57090f1d3cdee0c8028ded04abe2126ad2538c71 # Parent f6453d89b6068867ece7f3a36d25977124d18ea5 Added custom error. diff --git a/vcsserver/exceptions.py b/vcsserver/exceptions.py --- a/vcsserver/exceptions.py +++ b/vcsserver/exceptions.py @@ -53,6 +53,12 @@ def ArchiveException(org_exc=None): return _make_exception_wrapper +def ClientNotSupportedException(org_exc=None): + def _make_exception_wrapper(*args): + return _make_exception('client_not_supported', org_exc, *args) + return _make_exception_wrapper + + def LookupException(org_exc=None): def _make_exception_wrapper(*args): return _make_exception('lookup', org_exc, *args) diff --git a/vcsserver/hooks.py b/vcsserver/hooks.py --- a/vcsserver/hooks.py +++ b/vcsserver/hooks.py @@ -167,6 +167,8 @@ def _handle_exception(result): if exception_class == 'HTTPLockedRC': raise exceptions.RepositoryLockedException()(*result['exception_args']) + elif exception_class == 'ClientNotSupportedError': + raise exceptions.ClientNotSupportedException()(*result['exception_args']) elif exception_class == 'HTTPBranchProtected': raise exceptions.RepositoryBranchProtectedException()(*result['exception_args']) elif exception_class == 'RepositoryError':