Previous Topic: RemoteTarget.execute MethodNext Topic: RemoteTarget.getHostName Method


RemoteTarget.getError Method

This method returns detailed error information after a remote execution attempt fails.

This method has the following syntax:

getError()

The method returns one of the following error codes:

RemoteTarget.REM_ERR_NONE

Indicates success.

RemoteTarget.REM_ERR_CON

Indicates a connection error, for example, host unknown.

RemoteTarget.REM_ERR_AUTH

Indicates an authentication error.

RemoteTarget.REM_ERR_CHN

Indicates an error when establishing a channel.

RemoteTarget.REM_ERR_READ

Indicates an error when reading from a remote system.

RemoteTarget.REM_ERR_EXEC

Indicates an error when evaluating expressions.

RemoteTarget.REM_ERR_ABORT

Indicates when a user aborts an operation.

RemoteTarget.REM_ERR_DISC

Indicates an error when disconnecting from a remote system.

Example

Display detailed error information:

rt = new RemoteTarget("ascli1");
run-remote Math.sqrt(1) on rt -wait
switch(rt.getError())
{
    case RemoteTarget.REM_ERR_NONE:
        ? "Success"
        break;
    case RemoteTarget.REM_ERR_CON:
        ? "Error connecting"
        break;
    case RemoteTarget.REM_ERR_AUTH:
        ? "Error authenticating"
        break;
    case RemoteTarget.REM_ERR_CHN:
        ? "Error establishing channel" 
        break;
    case RemoteTarget.REM_ERR_READ:
        ? "Error reading from remote system"
        break;
    case RemoteTarget.REM_ERR_EXEC:
        ? "Error evaluating expression"
        break;
    case RemoteTarget.REM_ERR_ABORT:
        ? "Operation aborted by user"
        break;
    case RemoteTarget.REM_ERR_DISC:
        ? "Error disconnecting from remote system"
        break;
    default:
        ? "Unknown error"
}

See also:

RemoteTarget.errorOccurred Method

RemoteTarget.onError Method