mchades commented on code in PR #5067:
URL: https://github.com/apache/gravitino/pull/5067#discussion_r1804204510


##########
server/src/main/java/org/apache/gravitino/server/web/Utils.java:
##########
@@ -122,6 +122,28 @@ public static Response alreadyExists(String type, String 
message, Throwable thro
         .build();
   }
 
+  public static Response nonInUse(String message, Throwable throwable) {
+    return nonInUse(throwable.getClass().getSimpleName(), message, throwable);
+  }
+
+  public static Response nonInUse(String type, String message, Throwable 
throwable) {
+    return Response.status(Response.Status.CONFLICT)
+        .entity(ErrorResponse.nonInUse(type, message, throwable))
+        .type(MediaType.APPLICATION_JSON)
+        .build();
+  }
+
+  public static Response inUse(String message, Throwable throwable) {
+    return inUse(throwable.getClass().getSimpleName(), message, throwable);
+  }
+
+  public static Response inUse(String type, String message, Throwable 
throwable) {
+    return Response.status(Response.Status.CONFLICT)

Review Comment:
   `SERVICE_UNAVAILABLE(503, "Service Unavailable")` means the server status, 
not the resource. So I think it's not suitable.



-- 
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]

Reply via email to