Closed jeandemeusy closed 1 year ago
I implemented something following your idea @Teebor-Choka I think. Now, call_api() has the same behaviour as before, except is never raise an exception. _safe_call_api() make a call to call_api() and raises an exception if necessary. Thus the wrapper is not impacted by the change, and I can handle the exception on a higher level.
I implemented something following your idea @Teebor-Choka I think. Now, call_api() has the same behaviour as before, except is never raise an exception. _safe_call_api() make a call to call_api() and raises an exception if necessary. Thus the wrapper is not impacted by the change, and I can handle the exception on a higher level.
Semantically, it should be the other way around - _safe_api is used by all other methods and does not throw. The call_api
throws. _safe_api
calls the call_api
.
The call_api() method handles httpx exceptions, but the exceptions need to be re-raised, to that they can be managed on a higher level.