Skip to content

Nicer stacktrace - #973

Merged
max-wittig merged 1 commit into
python-gitlab:masterfrom
mitar:patch-1
Dec 16, 2019
Merged

Nicer stacktrace#973
max-wittig merged 1 commit into
python-gitlab:masterfrom
mitar:patch-1

Conversation

@mitar

@mitar mitar commented Dec 16, 2019

Copy link
Copy Markdown
Contributor

Otherwise the stacktrace is like:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gitlab/__init__.py", line 832, in next
    item = self._data[self._current]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./bot.py", line 241, in <module>
    main(sys.argv)
  File "./bot.py", line 209, in main
    for project in projects:
  File "/usr/local/lib/python3.6/site-packages/gitlab/base.py", line 184, in __next__
    return self.next()
  File "/usr/local/lib/python3.6/site-packages/gitlab/base.py", line 187, in next
    data = self._list.next()
  File "/usr/local/lib/python3.6/site-packages/gitlab/__init__.py", line 837, in next
    self._query(self._next_url)
  File "/usr/local/lib/python3.6/site-packages/gitlab/__init__.py", line 766, in _query
    result = self._gl.http_request("get", url, query_data=query_data, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/gitlab/__init__.py", line 562, in http_request
    response_body=result.content,
gitlab.exceptions.GitlabHttpError: 502: GitLab is not responding

@max-wittig

Copy link
Copy Markdown
Member

Thanks for the MR. Looks like a good usability change. Do you mind to follow the commit conventions?

feat: add nicer stacktrace

@mitar

mitar commented Dec 16, 2019

Copy link
Copy Markdown
Contributor Author

Ah, I forgot about that. I will fix it now.

@mitar

mitar commented Dec 16, 2019

Copy link
Copy Markdown
Contributor Author

Done.

@max-wittig
max-wittig merged commit 61eaad2 into python-gitlab:master Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants