fix(rest): align error handlers with Java implementation#763
Open
zhjwpku wants to merge 2 commits into
Open
Conversation
While reviewing apache#614, I noticed that `PlanErrorHandler::Accept` does not match the behavior of the Java implementation. A detailed comparison with Java's `ErrorHandlers` revealed several gaps between iceberg-cpp and Iceberg Java. Some of these are oversights in the original implementation, while others correspond to improvements that were made later in Iceberg Java, including: * apache/iceberg#13143 * apache/iceberg#14927 * apache/iceberg#15051 * apache/iceberg#16059 This PR closes those gaps and brings the error handling behavior in iceberg-cpp closer to the Java implementation.
wgtmac
reviewed
Jun 20, 2026
| case 409: | ||
| return AlreadyExists(error.message); | ||
| Status ConfigErrorHandler::Accept(const ErrorResponse& error) const { | ||
| if (error.code == 404 && !error.type.empty()) { |
Member
There was a problem hiding this comment.
This catches fallback errors too. If /config returns a plain 404 (bad base URI, proxy, etc.), BuildDefaultErrorResponse sets type to RESTException, so we report NoSuchWarehouse instead of a REST error. Java only maps parsed typed 404s here.
Collaborator
Author
There was a problem hiding this comment.
Good catched, fixed alone with a RESTException test case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
While reviewing #614, I noticed that
PlanErrorHandler::Acceptdoes not match the behavior of the Java implementation.A detailed comparison with Java's
ErrorHandlersrevealed several gaps between iceberg-cpp and Iceberg Java. Some of these are oversights in the original implementation, while others correspond to improvements that were made later in Iceberg Java, including:This PR closes those gaps and brings the error handling behavior in iceberg-cpp closer to the Java implementation.