File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -181,11 +181,13 @@ async def async_call_api(
181181 if exception := STATUS_EXCEPTIONS .get (response .status ):
182182 raise exception (message or response .data )
183183
184- if isinstance (response .data , dict ):
185- if message is not None :
186- if exception := MESSAGE_EXCEPTIONS .get (message ):
187- raise exception (message )
188- raise GitHubException (message )
184+ # For a 201 Created response, we assume the operation was successful and ignore any "message" field.
185+ if not response .status == HttpStatusCode .CREATED :
186+ if isinstance (response .data , dict ):
187+ if message is not None :
188+ if exception := MESSAGE_EXCEPTIONS .get (message ):
189+ raise exception (message )
190+ raise GitHubException (message )
189191
190192 if endpoint == "/graphql" and response .data .get ("errors" , []):
191193 raise GitHubGraphQLException (
You can’t perform that action at this time.
0 commit comments