Show error log for critical add image errors too

This commit is contained in:
adam-m 2012-06-27 16:55:59 -04:00
parent 7211e619c9
commit 764f4cea39
2 changed files with 9 additions and 11 deletions

View File

@ -98,8 +98,13 @@ final class AddImageVisualPanel2 extends JPanel {
void setNonCriticalErrors(final String errors) { void setErrors(final String errors, boolean critical) {
if (critical) {
progressLabel.setText("*Failed to add image (critical errors encountered). Click below to view the Add Image Log.");
}
else {
progressLabel.setText("*Image added (non-critical image errors encountered). Click below to view the Add Image Log."); progressLabel.setText("*Image added (non-critical image errors encountered). Click below to view the Add Image Log.");
}
errorButton = new JButton(); errorButton = new JButton();
errorButton.setText("View Log"); errorButton.setText("View Log");
infoPanel.add(errorButton); infoPanel.add(errorButton);

View File

@ -318,20 +318,13 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
revert(); revert();
if (hasCritError) { if (hasCritError) {
//core error //core error
StringBuilder errMsgB = new StringBuilder(); getComponent().setErrors(errorString, true);
errMsgB.append("<html>*Failed to add image");
if (errorString != null) {
errMsgB.append(": <br />").append(errorString);
} }
errMsgB.append("</html>");
getComponent().changeProgressBarTextAndColor(errMsgB.toString(), 0, Color.black);
}
return; return;
} else if (errorString != null) { } else if (errorString != null) {
//data error (non-critical) //data error (non-critical)
logger.log(Level.INFO, "Handling non-critical errors that occured in add image process"); logger.log(Level.INFO, "Handling non-critical errors that occured in add image process");
getComponent().setNonCriticalErrors(errorString); getComponent().setErrors(errorString, false);
} }
} }