lasdf1234 commented on code in PR #12880:
URL: https://github.com/apache/gravitino/pull/12880#discussion_r3931498852
##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/web/IdpRESTUtils.java:
##########
@@ -121,7 +122,10 @@ private static Response toErrorResponse(String errorMsg,
Exception e) {
if (e instanceof AlreadyExistsException) {
return alreadyExists(errorMsg, e);
}
- if (e instanceof IllegalStateException || e instanceof
UnsupportedOperationException) {
+ if (e instanceof NonEmptyEntityException) {
+ return Utils.nonEmpty(errorMsg, e);
+ }
Review Comment:
Could we avoid using Utils.nonEmpty and instead use "json(Response.xxx)" in
this way, making it consistent with the other ways this class constructs
responses? This way, the code seems more fair. What do you think?
--
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]