fix: omit error-check for 201 responses in async_call_api#391
fix: omit error-check for 201 responses in async_call_api#391ludeeus merged 4 commits intoludeeus:mainfrom
Conversation
7dacade to
80e18cb
Compare
Skip error-checking for responses with a 201 status code in async_call_api, preventing false error raises for successful REST operations.
80e18cb to
3a2c007
Compare
📝 WalkthroughWalkthroughThe error handling logic in the API client was updated to consider the HTTP status code when processing responses containing a "message" field. Specifically, if the status code is 201 (Created), the client will no longer raise a Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant GitHubAPI
Client->>GitHubAPI: Send API request
GitHubAPI-->>Client: Respond with status code and data
alt Response contains "message"
alt Status code is 201
Client-->>Client: Do not raise exception
else Status code is not 201
Client-->>Client: Raise GitHubException
end
else No "message" in response
Client-->>Client: Continue normal processing
end
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Proposed change
This PR modifies the error-handling logic in the
async_call_apimethod for REST API calls. GitHub sometimes returns a 201 (Created) status code along with a "message" field as part of a successful response. Since a 201 response always indicates success, this change omits the error-check for such responses, preventing false error raises. This fix applies to all REST API endpoints where a 201 status is expected.Type of change
Additional information
Checklist
make lint)