fix: Separates sync/async error handlers and makes 3 simple calls sync #819
+220
−195
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 PR improves the error handling system in the HTTP API, as a first step to solve issue #569. The motivation is to provide better support for both synchronous and asynchronous endpoints while maintaining backwards compatibility. Key changes include:
Error Handling Improvements:
Endpoint Adjustments:
Converted /info, /model/registry, and /device/stats to synchronous endpoints.
No new dependencies were introduced for this change.
Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
Testing was done using Docker to verify endpoint behavior:
Pre-change testing: Ensured the baseline functionality and error responses of all endpoints.
Post-change testing: Verified that the endpoints were still performing as they should.
Endpoints changed and tested:
/info (static version info)
/model/registry (in-memory model listing)
/device/stats (Docker stats via synchronous SDK)
Any specific deployment considerations
No changes in usability, usage, costs, or secrets were required. The inline documentation now reflects the synchronous or asynchronous nature of the handlers.
Docs
Updated to specify the new sync/async nature of endpoints.
Maintained backward compatibility documentation.