mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-20 16:24:11 +01:00
updated to reduce exception messages during build when mono isn't available
Former-commit-id: 734c3b41743c1ed60c6dbc737050b7add409206f
This commit is contained in:
@@ -243,10 +243,14 @@ public class AssemblyAnalyzer extends AbstractFileTypeAnalyzer {
|
|||||||
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");
|
throw new AnalysisException("Could not execute .NET AssemblyAnalyzer");
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
if (e instanceof AnalysisException) {
|
||||||
|
throw (AnalysisException) e;
|
||||||
|
} else {
|
||||||
LOGGER.warning("An error occured with the .NET AssemblyAnalyzer; "
|
LOGGER.warning("An error occured with the .NET AssemblyAnalyzer; "
|
||||||
+ "this can be ignored unless you are scanning .NET DLLs. Please see the log for more details.");
|
+ "this can be ignored unless you are scanning .NET DLLs. Please see the log for more details.");
|
||||||
LOGGER.log(Level.FINE, "Could not execute GrokAssembly {0}", e.getMessage());
|
LOGGER.log(Level.FINE, "Could not execute GrokAssembly {0}", e.getMessage());
|
||||||
throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e);
|
throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (rdr != null) {
|
if (rdr != null) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -59,7 +59,11 @@ public class AssemblyAnalyzerTest extends BaseTest {
|
|||||||
analyzer.supportsExtension("dll");
|
analyzer.supportsExtension("dll");
|
||||||
analyzer.initialize();
|
analyzer.initialize();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
if (e.getMessage().contains("Could not execute .NET AssemblyAnalyzer")) {
|
||||||
|
LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete");
|
||||||
|
} else {
|
||||||
LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete", e);
|
LOGGER.log(Level.WARNING, "Exception setting up AssemblyAnalyzer. Tests will be incomplete", e);
|
||||||
|
}
|
||||||
Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE", e);
|
Assume.assumeNoException("Is mono installed? TESTS WILL BE INCOMPLETE", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user