Jackie-Jiang commented on code in PR #13209:
URL: https://github.com/apache/pinot/pull/13209#discussion_r1612482593


##########
pinot-controller/src/test/java/org/apache/pinot/controller/api/access/AccessControlUtilsTest.java:
##########
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.controller.api.access;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import 
org.apache.pinot.controller.api.exception.ControllerApplicationException;
+import org.mockito.Mockito;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class AccessControlUtilsTest {
+
+    private final String _table = "testTable";

Review Comment:
   The format is incorrect. Can you reformat the changes with [Pinot 
Style](https://docs.pinot.apache.org/developers/developers-and-contributors/code-setup#set-up-ide)?



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/access/AccessControlUtils.java:
##########
@@ -67,9 +67,12 @@ public static void validatePermission(@Nullable String 
tableName, AccessType acc
     } catch (WebApplicationException exception) {
       // throwing the exception if it's WebApplicationException
       throw exception;
-    } catch (Exception e) {
+    } catch (Throwable t) {
+      // catch and log Throwable for NoSuchMethodError which can happen when 
there are classpath conflicts
+      // otherwise, grizzly will return a 500 without any logs or indication 
of what failed
+      LOGGER.error("Caught exception while validating permission for {}", 
userMessage, t);

Review Comment:
   We don't need to log error here. It will be logged within the 
`ControllerApplicationException` constructor



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to