Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #351 +/- ##
==========================================
+ Coverage 86.78% 87.27% +0.49%
==========================================
Files 20 20
Lines 1294 1336 +42
Branches 215 227 +12
==========================================
+ Hits 1123 1166 +43
Misses 81 81
+ Partials 90 89 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes error response handling for InfluxDB v3 endpoints that return structured JSON errors. Previously, the error parser only extracted simple message fields, but v3 endpoints can return detailed error objects with arrays of line-specific errors including line numbers and original line content. The fix implements proper parsing and formatting of these structured errors to provide more informative error messages.
Changes:
- Enhanced error message parsing in RestClient to handle v3 structured error responses with data arrays and objects
- Added comprehensive test coverage for various error response formats and edge cases
- Refactored test helper methods to separate content-type parameter from headers map
- Added junit-jupiter-params dependency for parameterized testing
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/influxdb/v3/client/internal/RestClient.java | Refactored error parsing logic into new formatErrorMessage method that handles v3 structured errors with data arrays/objects |
| src/test/java/com/influxdb/v3/client/internal/RestClientTest.java | Added comprehensive tests for v3 error formats including parameterized tests for edge cases |
| src/test/java/com/influxdb/v3/client/AbstractMockServerTest.java | Added contentType parameter overload to createResponse helper method |
| src/test/java/com/influxdb/v3/client/InfluxDBClientWriteTest.java | Updated test to use new createResponse signature |
| pom.xml | Added junit-jupiter-params dependency for parameterized testing |
| CHANGELOG.md | Documented bug fix for Enterprise/Core structured errors handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
11c0925 to
f8b6ccd
Compare
f8b6ccd to
5bdddad
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed Changes
v3 endpoint error can be a structured JSON. eg. write error:
{ "error": "partial write of line protocol occurred", "data": [ { "error_message": "invalid column type for column 'v', expected iox::column_type::field::integer, got iox::column_type::field::float", "line_number": 2, "original_line": "testa6a3ad v=1 17702" } ] }This PR fixes handling of such payload and resulting error message is constructed with all the error detail (and is aligned with other client libs such as
influxdb3-js,influxdb3-csharpetc):Checklist