Error Handling Enhancements #79
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces several improvements and enhancements to the existing Python script. The key changes are outlined below:
Enhanced Error Handling
_api_request
method. Specifically, when encountering a 409 HTTP status code and specific conditions are met (endpoint contains "task" andbody
contains a "unique_id"), the code checks for retry history and performs additional API requests to retrieve task data if necessary.Readability and Maintenance
Version Update
_version.py
file has been updated from "2.14.4" to "2.15.0," and the package name remains "scaleapi."Miscellaneous
How to Test
To test these changes, you can use the modified script in your existing project or application. Be sure to provide a valid API key when initializing the
Api
class.Additional Information
Please review and merge this pull request to incorporate these improvements into the project.