Interface CustomError
-
public interface CustomError
This class provides access to the InstallAnywhere error logging and end-user installation log features to Custom Actions, Panels, and Consoles.
The
CustomError
object is obtained through the InstallerProxy, CustomCodePanelProxy, and CustomCodeConsoleProxy objects by a request for the CustomError class, as follows:Given an instance of CustomCodePanelProxy proxy,
CustomError error = (CustomError)proxy.getService(CustomError.class);
error.appendError("the file was not found", CustomError.ERROR);
error.setLogDescription("File Mover: ");
error.setRemedialText("Blank file was not found. Create a new text file and place it in the TEMP directory.");
-
-
Field Summary
Fields Modifier and Type Field Description static int
ERROR
An error that prevents some part of the installation, but does not make the entire installation fail.static int
FATAL_ERROR
An error that causes the entire installation to fail.static int
WARNING
An error that doesn't prevent any installation from happening but might not be desired behavior.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
appendError(java.lang.String descriptionOfError, int errorCode)
This method adds an error to be recorded in the install log for this action.void
appendMessage(java.lang.String message)
This method adds a message to be recorded in the installation log.void
log()
This method adds the current error information contained in this instance of CustomError to the end-user installation log.void
setLogDescription(java.lang.String description)
This method provides a mechanism to describe the action that is reporting status.void
setRemedialText(java.lang.String remedy)
This method provides a mechanism for custom actions to describe corrective measures that the user can perform if the action is not able to completed due to an error.
-
-
-
Field Detail
-
WARNING
static final int WARNING
An error that doesn't prevent any installation from happening but might not be desired behavior.
- See Also:
- Constant Field Values
-
ERROR
static final int ERROR
An error that prevents some part of the installation, but does not make the entire installation fail.
- See Also:
- Constant Field Values
-
FATAL_ERROR
static final int FATAL_ERROR
An error that causes the entire installation to fail.
- See Also:
- Constant Field Values
-
-
Method Detail
-
setLogDescription
void setLogDescription(java.lang.String description)
This method provides a mechanism to describe the action that is reporting status.
The text will be seen in the end-user's installation log even if no errors are recorded, in the form, description: SUCCESSFUL.
- Parameters:
description
- a string, typically short, that describes the action for purposes of the error log, for example "File Counter: Text File Counter".
-
setRemedialText
void setRemedialText(java.lang.String remedy)
This method provides a mechanism for custom actions to describe corrective measures that the user can perform if the action is not able to completed due to an error.
The text will be seen in the log even if no errors are recorded by the action.
- Parameters:
remedy
- a string, which may be a sentence or paragraph, which describes what the user may do to complete this action if there has been an error.
-
appendError
void appendError(java.lang.String descriptionOfError, int errorCode)
This method adds an error to be recorded in the install log for this action.
The user may append multiple errors, and the installer may add others.
The error will be described in the error log by the descriptionOfError string.
- Parameters:
descriptionOfError
- a String that describes the error.errorCode
- an error code (must be either WARNING, ERROR, or FATAL_ERROR);
-
appendMessage
void appendMessage(java.lang.String message)
This method adds a message to be recorded in the installation log.
This message will come after the log description or will be the first line of the status description if no log description is set.
The user may append multiple messages before calling
log()
.Using this call will omit the status line from this log entry unless errors are also logged to this entry.
- Parameters:
message
- the message to be appended to this log entry
-
log
void log()
This method adds the current error information contained in this instance of CustomError to the end-user installation log.
If this method is not called, InstallAnywhere will NOT log the current information contained in the CustomError object. If other methods of this class are called after calling the
log()
method (e.g.,appendError()
), the additional information will be included as part of a new entry in the installation log.The log method can be called multiple times to generate multiple entries in the installation log for the end user of the installer.
-
-