frequenz-floss / frequenz-client-base-python

Base gRPC client
https://frequenz-floss.github.io/frequenz-client-base-python/
MIT License
0 stars 3 forks source link

Add a `client` attribute to `ApiClientError` #77

Open llucax opened 2 months ago

llucax commented 2 months ago

What's needed?

The ApiClientError will be used to report errors for many different types of clients, so we need an easy way to map an error to a particular client.

The error already saves the server_url, which could be potentially used for that, but if for some reason any user wants to instantiate 2 clients with the same URL, this won't be enough.

Proposed solution

Save a client property in the error instance too, pointing to the API client that generated the error.