Error-handling Commands
With the following commands and settings you can handle potential errors occurring during the application command-line processing.
Command Name |
Required Parameter |
Optional Parameter |
Description |
silent |
crashReportPath |
Suppress warning dialogs and crash reports uploads. The application will store reports to the specified location instead of showing the upload wizard. |
|
set |
"key=value" |
Set an application state variable. |
|
writeProgress |
fileName timeout |
Write a progress change into a specified file (fileName including the path) during a defined period of time (timeout in seconds). The file structure in the examples below. |
Setting Name | Key | Value | Default value |
Quit on error | appQuitOnError | bool | false |
Quit on required restart | appQuitOnReset | bool | false |
Minimal process duration | appProcessActionTime | int | 15 |
Action | appProcessAction | None | None |
PlaySound | |||
ExecuteProgram | |||
Command-line process* *relevant for: "appProcessAction=ExecuteProgram" |
appProcessExecCmd | string |
Examples and More Info
Supress crashes, errors and warning dialogs
RealityCapture.exe -silent c:\\CrashReportFolder ^
-set "appQuitOnError=true" ^
-set "appProcessActionTime=0" ^
-set "appProcessAction=ExecuteProgram" ^
-set "appProcessExecCmd=c:\\MyScripts\\ErrorWriter.bat $(processResult) $(processId) $(processDuration:d) c:\\ErrorReportFolder\\ErrorReport.txt"
- The -silent command with the parameter c:\\CrashReportFolder redirects crash reporting minidumps to the target folder CrashReportFolder. This command also suppresses warning dialogs.
- Setting appQuitOnError to True causes the application to quit if any error occurs.
- appProcessActionTime set to 0 means that we are interested in all processes whose duration is at least 0 seconds - so we are actually interested in every single process.
- Setting appProcessAction to 2 stands for setting it to "Execute a program".
- appProcessExecCmd is set to a specific command (batch script)ErrorWriter.bat with its full path c:\\MyScripts\\ErrorWriter.bat and necessary input parameters $(processResult) $(processId) $(processDuration:d) c:\\ErrorReportFolder\\ErrorReport.txt.
These three settings can be interpreted together in such a way that if process duration has taken more than the minimum specified time (0 seconds), then the application executes the program ErrorWriter.bat.
You can use values from the application as input parameters for the executed program, e.g.:
processResult - a number which represents a result of the process (the process has finished correctly if its processResult is 0),
processId - an ID of the process,
processDuration:d - a number which says how long it has taken to finish the process.
You can also use your own input parameters (e.g. c:\\ErrorReportFolder\\ErrorReport.txt) to send some necessary data into the script, like a name and full path to a text file where a report of discovered errors is written.
Here is a simple example of a short batch script ErrorWriter.bat:
if /i "%1" NEQ "0" (
if /i "%1" NEQ "1" (
echo An error occured by process %2 which finished with result code %1 in %3 seconds. > %4
)
)
where %1, %2, %3, %4 are input parameters $(processResult), $(processId), $(processDuration:d), c:\\ErrorReportFolder\\ErrorReport.txt. This script checks the value of the input parameter processResult. If the value is not 0, the process has finished with an error and the script writes a short report to the output ErrorReport text file:
An error occurred by process 20599 which finished with result code 2181038335 in 0 seconds.
Quit on Restart
There are some application settings that require application restart after changing them. In such cases, you can use the -set command with the key appQuitOnReset set to True to suppress the dialog. Please note that the application quits after using this key and changing the respective setting. Below you can find an example on how to change the cache directory to a custom location, and then open a new scene:
RealityCapture.exe -set "appQuitOnReset=true" ^
-set "appCacheLocation=Custom"
RealityCapture.exe -set "appQuitOnReset=true" ^
-set "appCacheCustomLocation=D:\cr-tmp"
RealityCapture.exe -newScene
Progress Monitoring
With the -writeProgress command, you are able to write a progress information into a specified file (fileName) during a defined period of time (timeout).
-writeProgress "c:\\ErrorReportFolder\\ProcessingProgress.txt"
The created file consists of these 5 columns:
algId – process ID,
progress – number from this interval <0,1> indicating a stage of a process,
duration – elapsed time in seconds,
estimation – estimated remaining time in seconds,
eventType – {started, progress, timeout, completed}, an event that produced a specific record.
20561 0.00 0.04 404.08 #started
20561 0.45 0.10 0.22 #progress
20561 0.85 14.76 3.26 #progress
20561 0.90 15.04 1.70 #progress
20561 0.91 16.18 1.76 #progress
20561 0.94 16.72 1.82 #progress
20561 0.96 16.78 1.42 #progress
20561 0.97 17.06 0.55 #progress
20561 1.00 17.10 0.10 #progress
20561 1.00 17.13 0.00 #completed
Comments
0 comments