mystic-ai / pipeline

Pipeline is an open source python SDK for building AI/ML workflows
https://www.mystic.ai
Apache License 2.0
117 stars 21 forks source link

Improve error handling #384

Closed rossgray closed 6 months ago

rossgray commented 6 months ago

Pull request outline

Currently when there are no resources available the error message we return is a bit verbose and could be a bit worrying for users (the default error message from httpx tells users to go to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503 for more info, which is a bit confusing).

This PR introduces 2 custom exceptions, APIError for general HTTP errors and NoResourcesAvailable for when a pipeline has not scaled up. This makes the error messaging nicer and also allows the user to use these exceptions in their own code.

Checklist: