tihomir-kit / InfluxData.Net

InfluxData TICK stack .net library.
MIT License
156 stars 52 forks source link

HTTP errors are handled inconsistently #82

Open Zero3 opened 5 years ago

Zero3 commented 5 years ago

Calling WriteAsync returns a IInfluxDataApiResponse which has the Success, StatusCode and Body properties. This implies that both successes and failures in calling InfluxDB will be communicated through the returned object.

But when the HTTP request to the database returns a HTTP 500 or 502 status, an InfluxDataApiException is thrown instead. This exception is undocumented and inconsistent with the return object. I think this is a bug.

Zero3 commented 5 years ago

I have been thinking some more about this issue: Perhaps the meaning of IInfluxDataApiResponse is to represent the response from InfluxDB if the call succeeds through the HTTP layer and reaches the logic layer of InfluxDB. If so, I guess the current behaviour is fine, and the issue here is the lack of documentation of InfluxDataApiException and under which circumstances it is thrown.