From 82935f688876aaba8a62834caf1bf37bf347224a Mon Sep 17 00:00:00 2001 From: ramabit Date: Fri, 22 Jan 2016 15:10:48 -0300 Subject: [PATCH] fix comments --- .../src/main/java/com/inaka/killertask/KillerTask.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/src/main/java/com/inaka/killertask/KillerTask.kt b/library/src/main/java/com/inaka/killertask/KillerTask.kt index 288fd5c..dff5dda 100644 --- a/library/src/main/java/com/inaka/killertask/KillerTask.kt +++ b/library/src/main/java/com/inaka/killertask/KillerTask.kt @@ -30,17 +30,15 @@ class KillerTask(val task: () -> T, val onSuccess: (T) -> Any, val onFailed: */ override fun onPostExecute(result: T) { Log.wtf(TAG, "Enter to onPostExecute") - if (!isCancelled) { - // task not cancelled - if (exception != null) { + if (!isCancelled) { // task not cancelled + if (exception != null) { // fail Log.wtf(TAG, "Failure with Exception") run { onFailed(exception) } - } else { + } else { // success Log.wtf(TAG, "Success") run { onSuccess(result) } } - } else { - // task cancelled + } else { // task cancelled Log.wtf(TAG, "Failure with RuntimeException caused by task cancelled") run { onFailed(RuntimeException("Task was cancelled")) } }