V8tr / SwiftCombineNetworking

Promise-Based Networking in Swift 5 with URLSession, Combine and Codable
https://www.vadimbulavin.com/
79 stars 17 forks source link

Task Error #1

Closed rarias84 closed 4 years ago

rarias84 commented 4 years ago

Task <9FAAED76-6691-4F6F-A6F4-909E4CEC28EB>.<1> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://xxxxx, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://xxxx}

V8tr commented 4 years ago

It seems like your publisher is released before network operation finishes. I am using withExtendedLifetime() to ensuretoken lifetime https://github.com/V8tr/SwiftCombineNetworking/blob/master/CombineNetworkLayer/main.swift#L27.

rarias84 commented 4 years ago

Yes, it worked, thanks.