File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from os import path
44from typing import Optional , Union
55
6- from gitlab .exceptions import GitlabGetError
6+ from gitlab .exceptions import GitlabGetError , GitlabHttpError
77from gitlab .v4 .objects import Project , ProjectCommit
88
99from gitlab_submodule .objects import Commit , Submodule
1010
11-
12- logger = logging .getLogger (__name__ )
13-
14-
1511logger = logging .getLogger (__name__ )
1612
1713
@@ -54,7 +50,7 @@ def _get_submodule_commit_id(
5450 submodule_dir = project .files .get (
5551 submodule_path ,
5652 ref = ref if ref else project .default_branch )
57- except GitlabGetError :
53+ except ( GitlabGetError , GitlabHttpError ) :
5854 raise FileNotFoundError (
5955 f'Local submodule path "{ submodule_path } " was not found for '
6056 f'project at url "{ project .web_url } " - check if your .gitmodules '
Original file line number Diff line number Diff line change 1- from typing import List , Optional , Union
2-
31import logging
42import re
53from posixpath import join , normpath
4+ from typing import List , Optional , Union
65
7- from gitlab .exceptions import GitlabGetError
6+ from gitlab .exceptions import GitlabGetError , GitlabHttpError
87from gitlab .v4 .objects import Project , ProjectManager
98from giturlparse import GitUrlParsed , parse
109
@@ -28,7 +27,7 @@ def submodule_to_project(
2827 try :
2928 submodule_project = project_manager .get (
3029 submodule_project_path_with_namespace )
31- except GitlabGetError :
30+ except ( GitlabGetError , GitlabHttpError ) :
3231 # Repo doesn't actually exist (possible because you can modify
3332 # .gitmodules without using `git submodule add`)
3433 raise FileNotFoundError (
You can’t perform that action at this time.
0 commit comments