This is an automated email from the ASF dual-hosted git repository.

wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new cc65bce97d AMBARI-25200: Ambari returns stack trace in HTML doc when 
an error occurs retrieving details for a user resource that does not exist 
(#3430)
cc65bce97d is described below

commit cc65bce97d94e5f0c305ccd0973939922bb87ce2
Author: Zhiguo Wu <wuzhi...@apache.org>
AuthorDate: Tue Oct 25 10:13:11 2022 +0800

    AMBARI-25200: Ambari returns stack trace in HTML doc when an error occurs 
retrieving details for a user resource that does not exist (#3430)
---
 .../server/controller/internal/UserPrivilegeResourceProvider.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java
index 37b4b5df95..acd7e2d2a1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProvider.java
@@ -278,7 +278,7 @@ public class UserPrivilegeResourceProvider extends 
ReadOnlyResourceProvider {
             }
           }
           usersCache.get().putAll(userNames);
-          userEntity = usersCache.get().getUnchecked(userName);
+          userEntity = usersCache.get().getIfPresent(userName);
         }
 
         if (userEntity == null) {
@@ -286,7 +286,7 @@ public class UserPrivilegeResourceProvider extends 
ReadOnlyResourceProvider {
         }
 
         if (userEntity == null) {
-          throw new SystemException("User was not found");
+          throw new NoSuchParentResourceException("User was not found");
         }
 
         final Collection<PrivilegeEntity> privileges = 
users.getUserPrivileges(userEntity);


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

Reply via email to