You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "shyjsarah (via GitHub)" <gi...@apache.org> on 2025/03/26 02:27:36 UTC
[PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
shyjsarah opened a new pull request, #5347:
URL: https://github.com/apache/paimon/pull/5347
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
Optimize ErrorResponse to support more ResourceType
<!-- Linking this pull request to the issue -->
Linked issue: close #xxx
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
Posted by "jerry-024 (via GitHub)" <gi...@apache.org>.
jerry-024 commented on code in PR #5347:
URL: https://github.com/apache/paimon/pull/5347#discussion_r2013408189
##########
paimon-core/src/main/java/org/apache/paimon/rest/DefaultErrorHandler.java:
##########
@@ -51,13 +51,13 @@ public void accept(ErrorResponse error) {
throw new ForbiddenException("Forbidden: %s", message);
case 404:
throw new NoSuchResourceException(
- error.getResourceType(), error.getResourceName(), "%s", message);
+ error.getResourceTypeEnum(), error.getResourceName(), "%s", message);
case 405:
Review Comment:
we could use ErrorResponseResourceType.fromString(resourceType) get enum. Then we needn't error.getResourceTypeEnum()
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
Posted by "jerry-024 (via GitHub)" <gi...@apache.org>.
jerry-024 commented on code in PR #5347:
URL: https://github.com/apache/paimon/pull/5347#discussion_r2013408189
##########
paimon-core/src/main/java/org/apache/paimon/rest/DefaultErrorHandler.java:
##########
@@ -51,13 +51,13 @@ public void accept(ErrorResponse error) {
throw new ForbiddenException("Forbidden: %s", message);
case 404:
throw new NoSuchResourceException(
- error.getResourceType(), error.getResourceName(), "%s", message);
+ error.getResourceTypeEnum(), error.getResourceName(), "%s", message);
case 405:
Review Comment:
we could use ErrorResponseResourceType.fromString(resourceType) get enum.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #5347:
URL: https://github.com/apache/paimon/pull/5347#discussion_r2013294950
##########
paimon-core/src/main/java/org/apache/paimon/rest/responses/ErrorResponse.java:
##########
@@ -75,10 +71,14 @@ public String getMessage() {
}
@JsonGetter(FIELD_RESOURCE_TYPE)
- public ErrorResponseResourceType getResourceType() {
+ public String getResourceType() {
return resourceType;
}
+ public ErrorResponseResourceType getResourceTypeEnum() {
Review Comment:
This looks weird, can we always use String? We can introduce string constants in this class.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #5347:
URL: https://github.com/apache/paimon/pull/5347#issuecomment-2753436644
+1
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [core] RESTCatalog: Optimize ErrorResponse to support more ResourceType [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #5347:
URL: https://github.com/apache/paimon/pull/5347
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org