| Quintiq file version 2.0 | 
| #parent: #root | 
| Method HandleCreateRunError (LibOpt_Run previousLastRun, LibOpt_Optimizer optimizer, QuillError e) | 
| { | 
|   Description: | 
|   [* | 
|     This method handles errors that occur during the creation of a `LibOpt_Run`. | 
|     A `LibOpt_Run` is passed in so that the `LibOpt_SnapshotError` can be added to the correct run. | 
|     If a `LibOpt_Run` initializes, but fails to start this would be the newest run belonging to the optimizer. | 
|     If the `LibOpt_Run` fails to initialize, a new run will be created and the error attached to that empty run. | 
|   *] | 
|   TextBody: | 
|   [* | 
|     // benlong Feb-11-2022 (created) | 
|     currentLastRun := maxselect( optimizer, Run, r, true, r.RunNr() ); | 
|     if( isnull( currentLastRun ) | 
|         or currentLastRun = previousLastRun ) | 
|     { | 
|       currentLastRun := LibOpt_Run::Create( optimizer ); | 
|     } | 
|     currentLastRun.IsFailed( true ); | 
|     LibOpt_SnapshotError::Throw( currentLastRun, LibOpt_SnapshotError::Read( e ) ); | 
|     LibOpt_Component::WriteErrorToLog( e ); | 
|     currentLastRun.RollbackOneTransaction(); | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |