Mitigate InfluxDB compatibility problems. #94
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately the v1 compatibility mode of v2 doesn't work as expected in case of error messages. See e.g. influxdata/influxdb#21173
While InfluxDB v1 always shows a
error
element int the response (see https://docs.influxdata.com/influxdb/v1.3/tools/api/), v2 also emits error messages without anerror
element (see https://docs.influxdata.com/influxdb/v2.7/api/v1-compatibility/).E.g. v2 could return something like
{"code":"unprocessable entity","message":"failure writing points to database: partial write: points beyond retention policy dropped=1"}
- which currently leads to aClientError
exception just showing the message that theerror
key isn't present and the requested URL (which is pretty useless since the original error message is swallowed).Therefore a small change to provide a workaround for this pretty ugly situation 😅
And for sure we all know that this is a problem of the InfluxDB - but maybe you would like to introduce this pretty small change to provide a workaround; if not, please feel free to just close this PR.
And independently thanks for providing this library ❤️