# Error Handling: Running Remote Commands

If you define a local file name when running a command remotely, the output of the transfer, whether successful or unsuccessful, is returned and stored with error codes.

When running a remote command in a Windows or UNIX system, you can define the LocalFileName parameter in the cfsend command, to store the output of the remote command. Otherwise, the output is written to your terminal. The RemoteFileName parameter is invalid and ignored. Based on how streams work in UNIX, stdout data is printed first, followed by the last 256 characters of stderr.

The types of error codes are listed as follows:

- When the function is successful, the return code is set as 0, and any output data is returned to the caller, in the same way as any other command.
- When the function is unsuccessful, the return code is set to a non-zero value, and a send error is returned to the caller along with a message indicating the cause of the failure.
- For network errors, the return code is normally 4, and the function can be retried.
- For severe errors, the return code is normally 8, and the function cannot be retried.

See the following list of errors that are not retried:

- Access control errors.
- Bad user ID or password.
- Checkpoint errors.
- CfAlias errors.
- Errors while starting a conversation.
- Errors while writing to a PQF file.
- Errors while trying to run the chmod command on the PQF file.
- Failure to connect SSL port without proper handshakes.
- Failure to apply a umask.
- Failure to run the cfdir or fusutil command.
- Failure to open files.
- Invalid encryption type for international version.
- Invalid encryption for HIPAA.
- Malloc errors (when system runs out of memory).
- Node is not defined when requirednodedefinition is set as Y.
- CRL authentication errors.
- SSL authentication errors.
- Severity-1 errors from the remote system.
- Security violation during Negotiation/Control record (when SSL and encryption is used).
- Tokens and wildcard character errors.

Copyright © 2022. TIBCO Software Inc. All Rights Reserved.