wendy / com.levibostian.wendy.service / Wendy / resolveError

resolveError

fun resolveError(taskId: Long): Boolean

Mark a previously recorded error for a PendingTask as resolved.

Note: If your PendingTask belongs to a group, this function will iterate all of the PendingTasks of that group and resolve the first (and only the first one) error that it comes upon. This is because (1) groups allow having "duplicate" PendingTasks in them (2) it is assumed that if an error is resolved for one PendingTask in a group, the error is resolved for all PendingTasks in the group and, well, a group cannot execute if the very first PendingTask is blocking the group from executing. So with this feature, you technically only have to keep track of 1 PendingTask.taskId in your app when you call Wendy.addTask for a PendingTask that belongs to a group instead of having to keep track of multiple PendingTask.taskIds for every time you call Wendy.addTask.

Note: If you attempt to resolve an error when an error does not exist in Wendy (because it has already been resolved or was never recorded) then the TaskRunnerListener.errorResolved and PendingTaskStatusListener.errorResolved will not be called.

Note: If WendyConfig.automaticallyRunTasks is true, the task runner will attempt to run your task after it has been resolved immediately. If the task belongs to a group, the task runner will attempt to run all the tasks in the group.

Parameters

taskId - The taskId of a PendingTask previously recorded an error for.

Exceptions

IllegalArgumentException - If the PendingTask for the taskId provided does not exist.

Return
If PendingTask had a previously recorded error and it has been marked as resolved now.

See Also

recordError