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

madhan pushed a commit to branch ranger-2.8
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/ranger-2.8 by this push:
     new fc34b23ac RANGER-5338: Make XMLUtils's error message more informative 
(#685)
fc34b23ac is described below

commit fc34b23acc30570a4b9430a344a940aba18b34b7
Author: Shohei Okumiya <[email protected]>
AuthorDate: Tue Nov 4 01:16:23 2025 +0900

    RANGER-5338: Make XMLUtils's error message more informative (#685)
    
    (cherry picked from commit 5180245f04a8677b4ffb955325a80d43ccbef561)
---
 .../src/main/java/org/apache/ranger/plugin/util/XMLUtils.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/agents-common/src/main/java/org/apache/ranger/plugin/util/XMLUtils.java 
b/agents-common/src/main/java/org/apache/ranger/plugin/util/XMLUtils.java
index 62477cb4b..7cbe2a500 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/util/XMLUtils.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/util/XMLUtils.java
@@ -48,7 +48,7 @@ public static void loadConfig(String configFileName, 
Map<Object, Object> propert
                try (InputStream input = getFileInputStream(configFileName)) {
                        loadConfig(input, properties);
                } catch (Exception e) {
-                       LOG.error("Error loading : ", e);
+                       LOG.error("Error loading : {}", configFileName, e);
                }
        }
 
@@ -132,6 +132,10 @@ private static InputStream getFileInputStream(String path) 
throws FileNotFoundEx
                        }
                }
 
+               if (ret == null) {
+                       throw new FileNotFoundException(path + " is not found");
+               }
+
                return ret;
        }
 

Reply via email to