Don't catch Throwables

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4967 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Wouter Zelle
2007-01-22 21:08:25 +00:00
parent 68e10b5157
commit 70b048e96e
2 changed files with 18 additions and 5 deletions

View File

@ -380,13 +380,23 @@ public class PMD {
ctx.getReport().addError(
new Report.ProcessingError(pmde.getMessage(),
fileName));
} catch (Throwable t) {
// unexepected exception: log and stop executor service
} catch (IOException ioe) {
// unexpected exception: log and stop executor service
if (debugEnabled) {
t.printStackTrace();
ioe.printStackTrace();
}
ctx.getReport().addError(
new Report.ProcessingError(t.getMessage(),
new Report.ProcessingError(ioe.getMessage(),
fileName));
executor.shutdownNow();
} catch (RuntimeException re) {
// unexpected exception: log and stop executor service
if (debugEnabled) {
re.printStackTrace();
}
ctx.getReport().addError(
new Report.ProcessingError(re.getMessage(),
fileName));
executor.shutdownNow();

View File

@ -559,7 +559,10 @@ public class GUI implements CPDListener {
setListDataFrom(cpd.getMatches());
}
} catch (Throwable t) {
} catch (IOException t) {
t.printStackTrace();
JOptionPane.showMessageDialog(frame, "Halted due to " + t.getClass().getName() + "; " + t.getMessage());
} catch (RuntimeException t) {
t.printStackTrace();
JOptionPane.showMessageDialog(frame, "Halted due to " + t.getClass().getName() + "; " + t.getMessage());
}