Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

Throws an error if the current transaction is cancelled.

void myScript.ThrowIfCancelled()

Remarks

This method is useful when you want to check the current transaction is cancelled and abort the current operation.

Example

function longRunningMethod() {
  
  var isCompleted = false;
  
  while(!isCompleted) {
  
    isCompleted = SomethingRunningLongTime();
    
    // break if cancelled
    Script.ThrowIfCancelled();
    
  }

}
  • No labels