Previous Topic: OSRedirect.clear MethodNext Topic: OSRedirect.errout Method


OSRedirect.errorOccurred Method

This method checks if an error occurs during remote execution. If an error occurs, errout() may provide an error description.

This method has the following syntax:

errorOccurred()

The method returns the following values:

true

Indicates that an error occurred.

false

Indicates that no error occurred.

Example

Execute invalid command with error check:

!! asdfghjk
if($$stdout.errorOccurred())
    ? "Error:", $$stdout.errout()
else
    ? $$stdout.output()

See also:

OSRedirect.errout Method

! Command--Invoke Command or Child Process (Cmdlet)

!! Command--Invoke Command or Child Process and Auto-capture Output (Cmdlet)