roryqi commented on code in PR #10668:
URL: https://github.com/apache/gravitino/pull/10668#discussion_r3035385730
##########
iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/IcebergRESTUtils.java:
##########
@@ -42,6 +44,25 @@
public class IcebergRESTUtils {
+ /**
+ * Error type names matching the Iceberg REST API specification examples.
See <a
+ *
href="https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml">Iceberg
+ * REST API spec</a>.
+ */
+ public static final Map<Integer, String> ERROR_TYPE_NAMES =
+ ImmutableMap.<Integer, String>builder()
+ .put(HttpServletResponse.SC_BAD_REQUEST, "BadRequestException")
+ .put(HttpServletResponse.SC_UNAUTHORIZED, "NotAuthorizedException")
+ .put(HttpServletResponse.SC_FORBIDDEN, "NotAuthorizedException")
Review Comment:
Now we only convert status to the correct string. Actually, what we want to
is convert underlying layer exception to upper layer exception. It would better
that we convert the exceptions explictly.
--
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]