Skip to content

Commit 5180245

Browse files
authored
RANGER-5338: Make XMLUtils's error message more informative (apache#685)
1 parent 27f9656 commit 5180245

File tree

1 file changed

+4
-1
lines changed
  • agents-common/src/main/java/org/apache/ranger/plugin/util

1 file changed

+4
-1
lines changed

agents-common/src/main/java/org/apache/ranger/plugin/util/XMLUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void loadConfig(String configFileName, Map<Object, Object> propert
5151
try (InputStream input = getFileInputStream(configFileName)) {
5252
loadConfig(input, properties);
5353
} catch (Exception e) {
54-
LOG.error("Error loading : ", e);
54+
LOG.error("Error loading : {}", configFileName, e);
5555
}
5656
}
5757

@@ -135,6 +135,9 @@ private static InputStream getFileInputStream(String path) throws FileNotFoundEx
135135
}
136136
}
137137

138+
if (ret == null) {
139+
throw new FileNotFoundException(path + " is not found");
140+
}
138141
return ret;
139142
}
140143
}

0 commit comments

Comments
 (0)