Skip to content

Comments

fix: V3 error response handling#351

Merged
bednar merged 15 commits intomainfrom
fix/v3-error-handling
Feb 19, 2026
Merged

fix: V3 error response handling#351
bednar merged 15 commits intomainfrom
fix/v3-error-handling

Conversation

@alespour
Copy link
Contributor

@alespour alespour commented Feb 16, 2026

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-csharp etc):

v3 write error message: partial write of line protocol occurred:
	line 2: invalid column type for column 'v', expected iox::column_type::field::integer, got iox::column_type::field::float (testa6a3ad v=1 17702)

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.27%. Comparing base (9704517) to head (93c3bef).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alespour alespour requested a review from Copilot February 16, 2026 14:57
@alespour alespour marked this pull request as ready for review February 16, 2026 15:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@alespour alespour force-pushed the fix/v3-error-handling branch from 11c0925 to f8b6ccd Compare February 17, 2026 06:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@bednar bednar merged commit 21258db into main Feb 19, 2026
10 checks passed
@bednar bednar deleted the fix/v3-error-handling branch February 19, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants