diff options
-rw-r--r-- | RELEASE_NOTES.rst | 1 | ||||
-rw-r--r-- | gitlab/mixins.py | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 2d6a05c..a9008f7 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -16,6 +16,7 @@ Changes from 1.1 to 1.2 ``set_token`` and ``set_credentials`` methods. Once a Gitlab object has been created its URL and authentication information cannot be updated: create a new Gitlab object if you need to use new information +* The ``todo()`` method raises a ``GitlabTodoError`` exception on error Changes from 1.0.2 to 1.1 ========================= diff --git a/gitlab/mixins.py b/gitlab/mixins.py index 3d6e321..c9243ed 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -113,7 +113,12 @@ class GetFromListMixin(ListMixin): GitlabAuthenticationError: If authentication is not correct GitlabGetError: If the server cannot perform the request """ - gen = self.list() + try: + gen = self.list() + except exc.GitlabListError: + raise exc.GitlabGetError(response_code=404, + error_message="Not found") + for obj in gen: if str(obj.get_id()) == str(id): return obj @@ -382,7 +387,7 @@ class SubscribableMixin(object): class TodoMixin(object): @cli.register_custom_action(('ProjectIssue', 'ProjectMergeRequest')) - @exc.on_http_error(exc.GitlabHttpError) + @exc.on_http_error(exc.GitlabTodoError) def todo(self, **kwargs): """Create a todo associated to the object. |