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) {
progressLabel.setText("*Image added (non-critical image errors encountered). Click below to view the Add Image Log.");
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.");
}
errorButton = new JButton();
errorButton.setText("View Log");
infoPanel.add(errorButton);

View File

@ -318,20 +318,13 @@ class AddImageWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
revert();
if (hasCritError) {
//core error
StringBuilder errMsgB = new StringBuilder();
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);
getComponent().setErrors(errorString, true);
}
return;
} else if (errorString != null) {
//data error (non-critical)
logger.log(Level.INFO, "Handling non-critical errors that occured in add image process");
getComponent().setNonCriticalErrors(errorString);
getComponent().setErrors(errorString, false);
}
}