forked from phoedos/pmd
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:
@ -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();
|
||||
|
@ -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());
|
||||
}
|
||||
|
Reference in New Issue
Block a user