Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ramabit committed Jan 22, 2016
1 parent 00cd082 commit 82935f6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions library/src/main/java/com/inaka/killertask/KillerTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ class KillerTask<T>(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")) }
}
Expand Down

0 comments on commit 82935f6

Please sign in to comment.