From 6494630dcca92b7a0b1ca4674a5d14cd8ea0f129 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Tue, 1 Oct 2024 08:29:46 -0700 Subject: [PATCH] fix: raise GitlabHeadError in `project.files.head()` method When an error occurs, raise `GitlabHeadError` in `project.files.head()` method. Closes: #3004 --- gitlab/v4/objects/files.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index cbadb67ec..cded0db2f 100644 --- a/gitlab/v4/objects/files.py +++ b/gitlab/v4/objects/files.py @@ -137,6 +137,7 @@ def get(self, file_path: str, ref: str, **kwargs: Any) -> ProjectFile: assert isinstance(server_data, dict) return self._obj_cls(self, server_data) + @exc.on_http_error(exc.GitlabHeadError) def head( self, file_path: str, ref: str, **kwargs: Any ) -> "requests.structures.CaseInsensitiveDict[Any]":