error
Specifies a file where you want a command to write the output if the command results in an error. If you do not specify the {--error | -r} option, the command writes the output to the console.
Syntax
{--error | -r} file
Arguments
Argument | Description |
file | Specifies the file where you want the error output written. If the file you specify does not exist, the command creates it. You can specify: ![*](bullet.gif) Absolute directory path and filename. ![*](bullet.gif) Relative directory path and filename. The path is relative from where you initiated the command. ![*](bullet.gif) Filename of a file in the same directory where you initiated the command. |
Usage Notes
![*](bullet.gif)
If the file you specify with the
{--error | -r} option already exists, the command overwrites the existing file with the new service results.
![*](bullet.gif)
If a command encounters an error, to help resolve errors, you can execute the command again using the
{--debug | -d} option to display additional information about the actual request and response.
![*](bullet.gif)
You can use the
{--error | r} option to direct error results to a specific location, for example, if you want to use automated tools to review output.
![*](bullet.gif)
If a command executes successfully, the command writes the output to the location specified by the
{--output | -o} option or the console if the
{--output | -o} option is not specified.
Examples
![*](bullet.gif)
To write error output to a file named “errors.xml” in the directory c:\outputs:
--error c:\outputs\errors.xml
![*](bullet.gif)
To write error output to a file named “errors.json” in the \outputs directory relative to where you initiate the command:
--error outputs\errors.json
![*](bullet.gif)
To write output to a file named “errors” in the same directory from where you initiate the command:
--error errors
In this example, the command determines the file extension based on the request content type.