mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 00:03:43 +01:00
updated error reporting for non-existent files
This commit is contained in:
@@ -113,6 +113,13 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
@Override
|
||||
public void analyzeDependency(Dependency dependency, Engine engine)
|
||||
throws AnalysisException {
|
||||
|
||||
File test = new File(dependency.getActualFilePath());
|
||||
if (!test.isFile()) {
|
||||
throw new AnalysisException(String.format("%s does not exist and cannot be analyzed by dependency-check",
|
||||
dependency.getActualFilePath()));
|
||||
}
|
||||
|
||||
if (grokAssemblyExe == null) {
|
||||
LOGGER.warn("GrokAssembly didn't get deployed");
|
||||
return;
|
||||
|
||||
@@ -173,7 +173,7 @@ public class AssemblyAnalyzerTest extends BaseTest {
|
||||
analyzer.analyze(d, null);
|
||||
fail("Expected an AnalysisException");
|
||||
} catch (AnalysisException ae) {
|
||||
assertEquals("File does not exist", ae.getMessage());
|
||||
assertTrue(ae.getMessage().contains("nonexistent.dll does not exist and cannot be analyzed by dependency-check"));
|
||||
} finally {
|
||||
System.setProperty(LOG_KEY, oldProp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user