InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.0: About user assistance >
6.6.0.2: Command line administration >
6.6.0.2.2: WebSphere Control Program (wscp) >
6.6.0.2.2.3: Advanced usage of wscp >
6.6.0.2.2.3.5: Obtaining status and error information

6.6.0.2.2.3.5: Obtaining status and error information

Successful wscp commands return a result, typically either a list of information or an empty string. When commands are run interactively, the Tcl result is displayed by the wscp shell. Failed wscp commands raise a TclException, which, unless there is a catch clause, stops the execution of the enclosing procedure.

When an exception is caught by wscp, the stack trace is appended to the Tcl variable errorInfo. You can view the stack trace by issuing either of the following commands:

wscp> puts $errorInfo
wscp> set errorInfo

The Tcl variable errorCode is set when wscp commands are executed. A nonzero value represents an error returned by the command.

Note:
Interactive users and writers of Tcl scripts must check this variable to determine whether a command succeeded or failed.

The errorCode variable is set to an integer (0 indicates success). The static statusToString method of com.ibm.ejs.sm.ejscp.WscpStatus can be used to translate an errorCode value. For example, the following Tcl procedure takes an errorCode value and translates it:

# Converts a WscpStatus to its corresponding string translation
#
proc statusToString {{status -1}} {
global errorCode
if {$status == -1 && $errorCode != "NONE"} {set status $errorCode}
java::call com.ibm.ejs.sm.ejscp.WscpStatus statusToString $status
}

Note that this Tcl procedure can be used to convert any error code; if an error code argument is not provided, the procedure converts the current value of the global errorCode variable.

The sample Tcl script init.tcl contains the statusToString procedure and other useful procedures for debugging. See 6.6.0.2.2.4.1: Initialization and general-purpose procedures.

Go to previous article: 6.6.0.2.2.3.4: Using wscp and operating system commands Go to next article: 6.6.0.2.2.3.6: Use of qualified home names in the administrative server

 

 
Go to previous article: 6.6.0.2.2.3.4: Using wscp and operating system commands Go to next article: 6.6.0.2.2.3.6: Use of qualified home names in the administrative server