Skip to content

ThrowIfCancelled

Throws when the current server script has been cancelled.

myScript.ThrowIfCancelled():void

Remarks

Server workflow scripts only. Call it inside long-running, cooperative loops; it does not interrupt work unless the script reaches this method.

Example

1
2
3
4
for (var index = 0; index < 1000; index++) {
    Script.ThrowIfCancelled();
    // Perform one bounded unit of work here.
}