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
@@ -435,7 +435,7 @@ class Requester:
cls = GithubException.UnknownObjectException
else:
cls = GithubException.GithubException
return cls(status, output)
return cls(status, output, headers)
def __structuredFromJson(self, data):
if len(data) == 0: