shangxinli commented on code in PR #358:
URL: https://github.com/apache/iceberg-cpp/pull/358#discussion_r2570735588
##########
src/iceberg/pending_update.h:
##########
@@ -89,6 +116,51 @@ class ICEBERG_EXPORT PendingUpdateTyped : public
PendingUpdate {
protected:
PendingUpdateTyped() = default;
+
+ /// \brief Add a validation error to be returned later
+ ///
+ /// Errors are accumulated and will be returned by Apply() or Commit().
+ /// This allows builder methods to continue and collect all errors rather
+ /// than failing fast on the first error.
+ ///
+ /// \param kind The kind of error
+ /// \param message The error message
+ void AddError(ErrorKind kind, std::string message) {
+ errors_.emplace_back(kind, std::move(message));
+ }
Review Comment:
sure
##########
src/iceberg/pending_update.h:
##########
@@ -72,6 +75,30 @@ class ICEBERG_EXPORT PendingUpdate {
/// Apply() can be used to validate and inspect the uncommitted changes before
/// committing. Commit() applies the changes and commits them to the table.
///
+/// Error Collection Pattern:
Review Comment:
make sense
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]