mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 11:51:10 +00:00
Raise on 404 error when getting data
This commit is contained in:
+7
-1
@@ -4,6 +4,9 @@ import base64
|
||||
|
||||
from GithubObjects import *
|
||||
|
||||
class UnknownGithubObject( Exception ):
|
||||
pass
|
||||
|
||||
class Github:
|
||||
def __init__( self, login, password ):
|
||||
self.__login = login
|
||||
@@ -11,7 +14,10 @@ class Github:
|
||||
|
||||
def _dataRequest( self, verb, url, parameters, data ):
|
||||
status, headers, data = self.__rawRequest( verb, url, parameters, data )
|
||||
return data
|
||||
if 200 <= status < 300:
|
||||
return data
|
||||
else:
|
||||
raise UnknownGithubObject()
|
||||
|
||||
def _statusRequest( self, verb, url, parameters, data ):
|
||||
status, headers, data = self.__rawRequest( verb, url, parameters, data )
|
||||
|
||||
Reference in New Issue
Block a user