@@ -36,14 +36,11 @@ class ICEBERG_REST_EXPORT ErrorHandler {
3636 public:
3737 virtual ~ErrorHandler () = default ;
3838
39- // TODO(Li Feiyang):removing ErrorModel as the inner layer and directly using
40- // ErrorResponse
41-
4239 // / \brief Process an error response and return an appropriate Error.
4340 // /
44- // / \param error The error model parsed from the HTTP response body
41+ // / \param error The error response parsed from the HTTP response body
4542 // / \return An Error object with appropriate ErrorKind and message
46- virtual Status Accept (const ErrorModel & error) const = 0;
43+ virtual Status Accept (const ErrorResponse & error) const = 0;
4744};
4845
4946// / \brief Default error handler for REST API responses.
@@ -52,7 +49,7 @@ class ICEBERG_REST_EXPORT DefaultErrorHandler : public ErrorHandler {
5249 // / \brief Returns the singleton instance
5350 static const std::shared_ptr<DefaultErrorHandler>& Instance ();
5451
55- Status Accept (const ErrorModel & error) const override ;
52+ Status Accept (const ErrorResponse & error) const override ;
5653
5754 protected:
5855 constexpr DefaultErrorHandler () = default;
@@ -64,7 +61,7 @@ class ICEBERG_REST_EXPORT NamespaceErrorHandler : public DefaultErrorHandler {
6461 // / \brief Returns the singleton instance
6562 static const std::shared_ptr<NamespaceErrorHandler>& Instance ();
6663
67- Status Accept (const ErrorModel & error) const override ;
64+ Status Accept (const ErrorResponse & error) const override ;
6865
6966 protected:
7067 constexpr NamespaceErrorHandler () = default;
@@ -76,7 +73,7 @@ class ICEBERG_REST_EXPORT DropNamespaceErrorHandler final : public NamespaceErro
7673 // / \brief Returns the singleton instance
7774 static const std::shared_ptr<DropNamespaceErrorHandler>& Instance ();
7875
79- Status Accept (const ErrorModel & error) const override ;
76+ Status Accept (const ErrorResponse & error) const override ;
8077
8178 private:
8279 constexpr DropNamespaceErrorHandler () = default;
@@ -88,7 +85,7 @@ class ICEBERG_REST_EXPORT TableErrorHandler final : public DefaultErrorHandler {
8885 // / \brief Returns the singleton instance
8986 static const std::shared_ptr<TableErrorHandler>& Instance ();
9087
91- Status Accept (const ErrorModel & error) const override ;
88+ Status Accept (const ErrorResponse & error) const override ;
9289
9390 private:
9491 constexpr TableErrorHandler () = default;
@@ -100,7 +97,7 @@ class ICEBERG_REST_EXPORT ViewErrorHandler final : public DefaultErrorHandler {
10097 // / \brief Returns the singleton instance
10198 static const std::shared_ptr<ViewErrorHandler>& Instance ();
10299
103- Status Accept (const ErrorModel & error) const override ;
100+ Status Accept (const ErrorResponse & error) const override ;
104101
105102 private:
106103 constexpr ViewErrorHandler () = default;
@@ -112,7 +109,7 @@ class ICEBERG_REST_EXPORT TableCommitErrorHandler final : public DefaultErrorHan
112109 // / \brief Returns the singleton instance
113110 static const std::shared_ptr<TableCommitErrorHandler>& Instance ();
114111
115- Status Accept (const ErrorModel & error) const override ;
112+ Status Accept (const ErrorResponse & error) const override ;
116113
117114 private:
118115 constexpr TableCommitErrorHandler () = default;
@@ -124,7 +121,7 @@ class ICEBERG_REST_EXPORT ViewCommitErrorHandler final : public DefaultErrorHand
124121 // / \brief Returns the singleton instance
125122 static const std::shared_ptr<ViewCommitErrorHandler>& Instance ();
126123
127- Status Accept (const ErrorModel & error) const override ;
124+ Status Accept (const ErrorResponse & error) const override ;
128125
129126 private:
130127 constexpr ViewCommitErrorHandler () = default;
0 commit comments