Script.ThrowIfCancelled

Overview

Throws an error if the current transaction is canceled.

void myScript.ThrowIfCancelled()

Remarks

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

Example

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

Copyright © 2010 - 2023 Emakin. All rights reserved.