From 2f207de1a0484be432b6c3ba741e2b1f86742409 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sat, 1 Mar 2014 06:40:29 -0500 Subject: [PATCH] made a broad catch even broader Former-commit-id: 2d88c89317b069e035e4d4fc698c323a183994a8 --- .../dependencycheck/analyzer/AssemblyAnalyzer.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java index 063a89f7f..787928379 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/AssemblyAnalyzer.java @@ -180,14 +180,14 @@ public class AssemblyAnalyzer extends AbstractAnalyzer { if (fos != null) { try { fos.close(); - } catch (Exception e) { + } catch (Throwable e) { LOG.fine("Error closing output stream"); } } if (is != null) { try { is.close(); - } catch (Exception e) { + } catch (Throwable e) { LOG.fine("Error closing input stream"); } } @@ -201,14 +201,16 @@ public class AssemblyAnalyzer extends AbstractAnalyzer { final XPath xpath = XPathFactory.newInstance().newXPath(); final String error = xpath.evaluate("/assembly/error", doc); if (p.exitValue() != 1 || error == null || "".equals(error)) { - LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details."); + LOG.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."); LOG.fine("GrokAssembly.exe is not working properly"); grokAssemblyExe = null; throw new AnalysisException("Could not execute .NET AssemblyAnalyzer"); } - } catch (Exception e) { - LOG.warning("An error occured with the .NET AssemblyAnalyzer, please see the log for more details."); - LOG.fine("Could not execute GrokAssembly " + e.getMessage()); + } catch (Throwable e) { + LOG.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."); + LOG.log(Level.FINE, "Could not execute GrokAssembly {0}", e.getMessage()); throw new AnalysisException("An error occured with the .NET AssemblyAnalyzer", e); }