Closed kohsuke closed 2 weeks ago
The changes involve updates to the error handling and output messaging within the subset
command of the launchable/commands/subset.py
file. The error message handling for API responses has been simplified, and additional checks for conflicting command options have been implemented to provide clearer user feedback. In the launchable/utils/http_client.py
file, modifications to the _HttpClient
class enhance the handling of HTTP responses, particularly for error codes. A new test method has also been added to verify the correct propagation of error messages in the tests/utils/test_http_client.py
file.
File | Change Summary |
---|---|
launchable/commands/subset.py | Updated error message handling for 422 status code; refined conflict checks for command options; minor output adjustments. |
launchable/utils/http_client.py | Added logic to handle HTTP responses with status codes of 400 or higher, extracting JSON reason messages when available. |
tests/utils/test_http_client.py | Added test_reason method to verify error message propagation for 500 status code responses. |
sequenceDiagram
participant User
participant SubsetCommand
participant HttpClient
User->>SubsetCommand: Execute command
SubsetCommand->>HttpClient: Send request
HttpClient-->>SubsetCommand: Response (status code)
alt status code 422
SubsetCommand-->>User: Display error message (simplified)
else conflicting options
SubsetCommand-->>User: Display conflict message
else status code 400 or higher
HttpClient-->>SubsetCommand: Extract reason from JSON
SubsetCommand-->>User: Display error message (from JSON)
end
🐰 In the meadow where bunnies play,
New messages brighten the day!
Conflicts now clear, errors refined,
With each command, joy we find.
Hops of delight, we cheer and sway,
For clearer paths in our coding way! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Summary by CodeRabbit
New Features
subset
command, providing clearer feedback on command conflicts and API response issues.Bug Fixes
Tests