 						do {
 							try self.store(value, for: image)
 							observer.send(value: value)
-							observer.sendCompleted()
 						} catch let error as ImageServiceError {
-							observer.send(error: error)
+							print(error)
+							//observer.send(error: error)
 						} catch {}
+						observer.sendCompleted()
 					case let .failure(error):
-						observer.send(error: ImageServiceError.FailedDownload(image: image,
-																			  description: error.localizedDescription))
+						/*observer.send(error: ImageServiceError.FailedDownload(image: image,
+																			  description: error.localizedDescription))*/
+						let imageServiceError = ImageServiceError.FailedDownload(image: image,
+						                                                         description: error.localizedDescription)
+						print(imageServiceError)
+						if let refreshTrace = self.refreshTrace {
+							refreshTrace.incrementCounter(named: "failed")
+						}
+						observer.sendCompleted()
 					}
 				})
 			} catch let error as ImageServiceError {

	private let baseDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
	private var cacheDirectory: URL
	private let apiConnection: ApiConnectionProtocol

	required init(dataContext: DataContextProtocol, apiConnection: ApiConnectionProtocol) throws {
		cacheDirectory = baseDirectory.appendingPathComponent(ImageService.cacheDirectoryName, isDirectory: true)

				disposable += resultsProducer.flatten(.merge).start({ event in
					switch event {
					case .value:
						self.refreshTrace?.incrementCounter(named: "downloaded")
						progress.completedUnitCount += 1
						observer.send(value: progress)
						print("Image caching completed by \(progress.fractionCompleted)")
					case let .failed(error):
						print("Error while caching images from sync: \(error)")
						self.refreshTrace?.stop()
						self.refreshTrace = nil
						observer.send(error: error)
					case .completed:
						print("Finished caching images from sync")
						self.refreshTrace?.stop()
						self.refreshTrace = nil
						observer.sendCompleted()
					case .interrupted:
						print("Caching images from sync interrupted")
						self.refreshTrace?.stop()
						self.refreshTrace = nil
						observer.sendInterrupted()
					}
				})
			} catch let error as ImageServiceError {
				self.refreshTrace?.stop()
				self.refreshTrace = nil
				observer.send(error: error)
			} catch {
				self.refreshTrace?.stop()
				self.refreshTrace = nil
				observer.send(error: ImageServiceError.FailedCacheDirectory(url: self.cacheDirectory, description: nil))
			}
		}
