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.
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 andNoResourcesAvailable
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: