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

dmitriusan pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


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

commit d7248a3177bebbba66f7df9004ee85cb548e643b
Author: Lisnichenko Dmitro <dmitriu...@apache.org>
AuthorDate: Tue Mar 19 18:46:00 2019 +0200

    AMBARI-25200. Ambari returns stack trace in HTML doc when an error occurs 
retrieving details for a user resource that does not exist (dlysnichenko) 
(#2879)
---
 .../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 7d66b48..5a5c870 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
@@ -279,7 +279,7 @@ public class UserPrivilegeResourceProvider extends 
ReadOnlyResourceProvider {
             }
           }
           usersCache.get().putAll(userNames);
-          userEntity = usersCache.get().getUnchecked(userName);
+          userEntity = usersCache.get().getIfPresent(userName);
         }
 
         if (userEntity == null) {
@@ -287,7 +287,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);

Reply via email to