Export headers in GithubException (#1887)

Since the headers that led to an exception are also useful, firstly pass
them into the constructor, and then export them in a property. Test one
specific use case to make sure of coverage.

Fixes #1814
This commit is contained in:
Steve Kowalik
2021-03-23 13:47:05 +11:00
committed by GitHub
parent e0acd8f466
commit ddd437a7cd
5 changed files with 20 additions and 7 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ class CompletableGithubObject(GithubObject):
def __complete(self):
if self._url.value is None:
raise GithubException.IncompletableObject(
400, "Returned object contains no URL"
400, "Returned object contains no URL", None
)
headers, data = self._requester.requestJsonAndCheck("GET", self._url.value)
self._storeAndUseAttributes(headers, data)