Skip to content

Conversation

@HeartLinked
Copy link

@HeartLinked HeartLinked commented Dec 10, 2025

Which issue does this PR close?

What changes are included in this PR?

Currently we only have a simple deserialize_unexpected_catalog_error function for errors. Adds a comprehensive error handling system for the REST catalog. Related java implementation is in ErrorHandlers.java.

  • Introduce an ErrorHandler Trait.
  • Implement specific handlers like NamespaceErrorHandler .
  • Implement a unified helper in HttpClient to handle the Async IO and JSON parsing.

Also, I fixed to handle OAuth error response with OAuth-specific error format. OAuth errors currently use a format per RFC 6749:

 {
   "error": "invalid_client",
   "error_description": "Client authentication failed"
 }

This differs from standard REST catalog errors which use:

{
  "error": {
    "message": "...",
    "type": "NoSuchTableException",
    "code": 404
  }
}

So I parses the OAuth error format and converts it to ErrorResponse format for compatibility with error handlers.

Are these changes tested?

unit test, integration test. Currently the integration test only covers the successful cases. After this PR, the failed cases are added.

@HeartLinked HeartLinked force-pushed the rest/error-handler branch 6 times, most recently from c9f5631 to cc2a272 Compare December 11, 2025 02:47
@HeartLinked HeartLinked marked this pull request as ready for review December 11, 2025 02:48
@HeartLinked
Copy link
Author

Hi, I’ve been contributing to iceberg-cpp quite a bit over the past few months, and picked up a ton of experience. This is my first PR for iceberg-rust, and I’m really happy to be part of this awesome community now. Looking forward to the review! @Xuanwo @liurenjie1024 :)

@HeartLinked HeartLinked marked this pull request as draft December 11, 2025 02:55
@HeartLinked HeartLinked marked this pull request as ready for review December 11, 2025 03:08
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.

Add comprehensive error handling system for REST catalog

1 participant