Gio.Task.prototype.return_error_if_cancelled

function return_error_if_cancelled(): Boolean {
    // Gjs wrapper for g_task_return_error_if_cancelled()
}
  

Checks if task's Gio.Cancellable has been cancelled, and if so, sets task's error accordingly and completes the task (see Gio.Task.prototype.return_pointer for more discussion of exactly what this means).

Since 2.36

Returns

true if task has been cancelled, false if not