Skip to content

Commit

Permalink
Add errors to finishing method
Browse files Browse the repository at this point in the history
  • Loading branch information
ffried committed Sep 24, 2020
1 parent 4b21d89 commit 21bcde9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/GCDCoreOperations/Base Classes/Operation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ open class Operation {
errors.append(contentsOf: errs.lazy.map { $0 })
_state.withValue { $0 = .finished(cancelled: cancelled) }

didFinish(wasCancelled: cancelled)
didFinish(wasCancelled: cancelled, errors: errors)
observers.operationDidFinish(self, wasCancelled: cancelled, errors: errors)

if cancelled {
Expand Down Expand Up @@ -216,11 +216,11 @@ open class Operation {
cancel(with: errors)
}

open func didFinish(wasCancelled: Bool) {}
open func didFinish(wasCancelled: Bool, errors: [Error]) {}
}

// MARK: - Nested Types
internal extension Operation {
extension Operation {
enum State: Comparable, CustomStringConvertible {
case created
case enqueued
Expand Down

0 comments on commit 21bcde9

Please sign in to comment.