mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Check HTTP status on all requests
This commit is contained in:
@@ -1,38 +1,43 @@
|
||||
{% if method.type.name != "bool" %}
|
||||
if self.__requester.isFailureStatus( status ): # pragma no branch
|
||||
raise GithubException( status, data ) # pragma no cover
|
||||
{% endif %}
|
||||
|
||||
{% if method.isMutation %}
|
||||
self.__useAttributes( data )
|
||||
{% endif %}
|
||||
|
||||
{% if method.type.simple %}
|
||||
|
||||
{% if method.type.cardinality == "scalar" %}
|
||||
{% if method.type.cardinality == "scalar" %}
|
||||
|
||||
{% if method.type.name == "@todo" %}
|
||||
return data
|
||||
{% endif %}
|
||||
|
||||
{% if method.type.name == "bool" %}
|
||||
{% if method.type.name == "bool" %}
|
||||
return status == 204
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if method.type.cardinality == "list" %}
|
||||
{% if method.type.name == "@todo" %}
|
||||
return data
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if method.type.cardinality == "list" %}
|
||||
return data
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% if method.type.cardinality == "scalar" %}
|
||||
{% if method.type.cardinality == "scalar" %}
|
||||
return {% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }}( self.__requester, data, completed = True )
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if method.type.cardinality == "list" %}
|
||||
{% if method.type.cardinality == "list" %}
|
||||
return PaginatedList.PaginatedList(
|
||||
{% if method.type.name != class.name %}{{ method.type.name }}.{% endif %}{{ method.type.name }},
|
||||
self.__requester,
|
||||
headers,
|
||||
data
|
||||
)
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user