Top  Previous  Next


The Try command provides recovery from FreeFlyer error messages and enables the user to perform some measure of diagnostics on the error to determine what went wrong. FreeFlyer suppresses any errors that are produced within the scope of the Try/End block of commands and then populates the Diagnostics object with information related to the error.



Try stepping a Spacecraft for 100 days:


mySpacecraft.A = 6478;
String StartEpoch = mySpacecraft.EpochText;
    While(mySpacecraft.ElapsedTime < TIMESPAN(100 days));
          Step mySpacecraft;
Report "Analysis began at the following Spacecraft Epoch: ", StartEpoch to Console;

Report "   Spacecraft impacted Earth at: ", mySpacecraft.EpochText to Console;


Try, while incrementing an ErrorCount variable if an error is encountered:


While(mySpacecraft.ElapsedTime < TIMESPAN(100 days));
    Try sending ErrorCount to myVariable;
          Step mySpacecraft;
    If (myVariable> 0);




If the "Try sending ErrorCount to ..." syntax option is used, FreeFlyer increments the user-specified "counter" Variable every time an error is encountered and suppressed.

oIn the example shown above, if an error is encountered, the current value of myVariable will be incremented; that is, FreeFlyer will perform this change behind the scenes: myVariable += 1.


If an error is encountered, FreeFlyer will exit the Try block and execute any remaining commands in the Mission Plan.


Errors fall into the category of recoverable errors and unrecoverable errors which have different behaviors in a Try block.

oRecoverable errors are those where all affected objects can be returned to an expected, earlier state. These are caught by the Try command and will be reported to Diagnostics.

oUnrecoverable errors are those which leave objects in an undefined or unknown state and from which objects can not be fully returned to expected, earlier states. These errors will continue to result in error messages that stop execution of a FreeFlyer Mission Plan even when they are trapped within a Try block.

oA vast majority of errors in FreeFlyer are recoverable. It is possible that a user could encounter an unrecoverable error, however, that could get through the Try block interface. These should be reported to FreeFlyer technical support if found.



Command Editor

Send error count to

Variable object which will store a counter indicating the number of errors that have been encountered and suppressed



Displays the FreeFlyer Script that is generated by the editor



Displays descriptions of the editor and its fields

Description text changes as the mouse pointer moves over the different fields within the editor




See Also


Diagnostics Properties and Methods