mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 18:11:47 +01:00
updated error reporting for non-existent files
This commit is contained in:
@@ -113,6 +113,13 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
@Override
|
@Override
|
||||||
public void analyzeDependency(Dependency dependency, Engine engine)
|
public void analyzeDependency(Dependency dependency, Engine engine)
|
||||||
throws AnalysisException {
|
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) {
|
if (grokAssemblyExe == null) {
|
||||||
LOGGER.warn("GrokAssembly didn't get deployed");
|
LOGGER.warn("GrokAssembly didn't get deployed");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ public class AssemblyAnalyzerTest extends BaseTest {
|
|||||||
analyzer.analyze(d, null);
|
analyzer.analyze(d, null);
|
||||||
fail("Expected an AnalysisException");
|
fail("Expected an AnalysisException");
|
||||||
} catch (AnalysisException ae) {
|
} 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 {
|
} finally {
|
||||||
System.setProperty(LOG_KEY, oldProp);
|
System.setProperty(LOG_KEY, oldProp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user