mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-24 18:11:47 +01:00
fixed error handling
This commit is contained in:
@@ -155,6 +155,11 @@ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
|
if (!file.exists()) {
|
||||||
|
final String msg = String.format("Suppression file '%s' does not exists", file.getPath());
|
||||||
|
LOGGER.warn(msg);
|
||||||
|
throw new SuppressionParseException(msg);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
rules.addAll(parser.parseSuppressionRules(file));
|
rules.addAll(parser.parseSuppressionRules(file));
|
||||||
LOGGER.debug("{} suppression rules were loaded.", rules.size());
|
LOGGER.debug("{} suppression rules were loaded.", rules.size());
|
||||||
@@ -168,6 +173,8 @@ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
|
|||||||
throwSuppressionParseException("Unable to fetch the configured suppression file", ex);
|
throwSuppressionParseException("Unable to fetch the configured suppression file", ex);
|
||||||
} catch (MalformedURLException ex) {
|
} catch (MalformedURLException ex) {
|
||||||
throwSuppressionParseException("Configured suppression file has an invalid URL", ex);
|
throwSuppressionParseException("Configured suppression file has an invalid URL", ex);
|
||||||
|
} catch (SuppressionParseException ex) {
|
||||||
|
throw ex;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throwSuppressionParseException("Unable to create temp file for suppressions", ex);
|
throwSuppressionParseException("Unable to create temp file for suppressions", ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user