Allow the specification of installation error pages within the getdown.txt file. This will let applications direct users to a particular URL for installation support. If none is specified, the same old generic text will be used.

This commit is contained in:
Mike Thomas
2006-03-14 01:58:50 +00:00
parent a748358d58
commit 536a566a2d
3 changed files with 28 additions and 11 deletions
@@ -83,6 +83,9 @@ public class Application
/** The color of the text shadow. */
public Color textShadow;
/** Where to point the user for help with install errors. */
public String installError;
}
/** Used by {@link #verifyMetadata} to communicate status in
@@ -334,6 +337,15 @@ public class Application
ui.backgroundImage = (String)cdata.get("ui.background");
}
ui.progressImage = (String)cdata.get("ui.progress_image");
// On an installation error, where do we point the user.
ui.installError = (String)cdata.get("ui.install_error");
if (ui.installError == null) {
ui.installError = "m.default_install_error";
} else {
ui.installError = MessageUtil.taint(ui.installError);
}
return ui;
}
@@ -109,13 +109,15 @@ public class Getdown extends Thread
Log.logStackTrace(e);
String msg = e.getMessage();
if (msg == null) {
msg = "m.unknown_error";
msg = MessageUtil.compose("m.unknown_error", _ifc.installError);
} else if (!msg.startsWith("m.")) {
// try to do something sensible based on the type of error
if (e instanceof FileNotFoundException) {
msg = MessageUtil.tcompose("m.missing_resource", msg);
msg = MessageUtil.compose("m.missing_resource",
MessageUtil.taint(msg), _ifc.installError);
} else {
msg = MessageUtil.tcompose("m.init_error", msg);
msg = MessageUtil.compose("m.init_error",
MessageUtil.taint(msg), _ifc.installError);
}
}
updateStatus(msg);
@@ -341,13 +343,15 @@ public class Getdown extends Thread
Log.logStackTrace(e);
String msg = e.getMessage();
if (msg == null) {
msg = "m.unknown_error";
msg = MessageUtil.compose("m.unknown_error", _ifc.installError);
} else if (!msg.startsWith("m.")) {
// try to do something sensible based on the type of error
if (e instanceof FileNotFoundException) {
msg = MessageUtil.tcompose("m.missing_resource", msg);
msg = MessageUtil.compose("m.missing_resource",
MessageUtil.taint(msg), _ifc.installError);
} else {
msg = MessageUtil.tcompose("m.init_error", msg);
msg = MessageUtil.compose("m.init_error", msg,
MessageUtil.taint(msg), _ifc.installError);
}
}
updateStatus(msg);
@@ -54,15 +54,16 @@ m.unable_to_repair = We were unable to download the necessary files after \
fails you may need to uninstall and reinstall.
m.unknown_error = The application has failed to launch due to some strange \
error from which we could not recover. Please visit the support section \
of the website for information on how to recover.
error from which we could not recover. Please visit\n{0} for information on \
how to recover.
m.init_error = The application has failed to launch due to the following \
error:\n{0}\n\nPlease visit the support section of the website for \
error:\n{0}\n\nPlease visit\n{1} for \
information on how to handle such problems.
m.missing_resource = The application has failed to launch due to a \
missing resource:\n{0}\n\nPlease visit the support section of the \
website for information on how to handle such problems.
missing resource:\n{0}\n\nPlease visit\n{1} for information on how to handle such problems.
m.default_install_error = the support section of the website
# application/digest errors
m.missing_appbase = The configuration file is missing the 'appbase'.