Show an error message that's actually fatal to the program. This is an error that can't be recovered. Use showWarning() for errors that allow P5 to continue running.
(String title, String message, Throwable e)
| 138 | * for errors that allow P5 to continue running. |
| 139 | */ |
| 140 | static public void showError(String title, String message, Throwable e) { |
| 141 | if (title == null) title = "Error"; |
| 142 | |
| 143 | if (Base.isCommandLine()) { |
| 144 | System.err.println(title + ": " + message); |
| 145 | |
| 146 | } else { |
| 147 | JOptionPane.showMessageDialog(new Frame(), message, title, |
| 148 | JOptionPane.ERROR_MESSAGE); |
| 149 | } |
| 150 | if (e != null) e.printStackTrace(); |
| 151 | System.exit(1); |
| 152 | } |
| 153 | |
| 154 | |
| 155 | /** |
no test coverage detected