IOS-1480 Move ReportingErrorContainer. refactor
authorDirk Zimmermann <dz@pep.security>
Tue, 12 Feb 2019 16:04:14 +0100
branchrefactor
changeset 76207caf4d149c17
parent 7619 03beef1152ba
child 7621 47d2b38d27c8
IOS-1480 Move ReportingErrorContainer.
pEpForiOS.xcodeproj/project.pbxproj
pEpForiOS/Background/Error/ReportingErrorContainer.swift
     1.1 --- a/pEpForiOS.xcodeproj/project.pbxproj	Tue Feb 12 16:04:14 2019 +0100
     1.2 +++ b/pEpForiOS.xcodeproj/project.pbxproj	Tue Feb 12 16:04:14 2019 +0100
     1.3 @@ -203,7 +203,6 @@
     1.4  		15BA536C20A08D270090F126 /* UnifiedInbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BA536B20A08D270090F126 /* UnifiedInbox.swift */; };
     1.5  		15BA536E20A095410090F126 /* UnifiedInboxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BA536D20A095410090F126 /* UnifiedInboxTest.swift */; };
     1.6  		15BA537020A0A4350090F126 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43980EDF1CBD24B000A7FC3C /* Log.swift */; };
     1.7 -		15BBBC631FD0496800B9DCC8 /* ReportingErrorContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BBBC621FD0496800B9DCC8 /* ReportingErrorContainer.swift */; };
     1.8  		15BBBC681FD04DFC00B9DCC8 /* ReportingErrorContainerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BBBC671FD04DFC00B9DCC8 /* ReportingErrorContainerTest.swift */; };
     1.9  		15BBBC6B1FD0527200B9DCC8 /* DisplayUserErrorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15BBBC6A1FD0527200B9DCC8 /* DisplayUserErrorTest.swift */; };
    1.10  		15BBBC6C1FD05F4300B9DCC8 /* DisplayUserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152130531FD00B7A00688DF2 /* DisplayUserError.swift */; };
    1.11 @@ -813,7 +812,6 @@
    1.12  		15BA536B20A08D270090F126 /* UnifiedInbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnifiedInbox.swift; sourceTree = "<group>"; };
    1.13  		15BA536D20A095410090F126 /* UnifiedInboxTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedInboxTest.swift; sourceTree = "<group>"; };
    1.14  		15BA537B20A1F5F50090F126 /* MoveToAccountViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoveToAccountViewController.swift; sourceTree = "<group>"; };
    1.15 -		15BBBC621FD0496800B9DCC8 /* ReportingErrorContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportingErrorContainer.swift; sourceTree = "<group>"; };
    1.16  		15BBBC671FD04DFC00B9DCC8 /* ReportingErrorContainerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportingErrorContainerTest.swift; sourceTree = "<group>"; };
    1.17  		15BBBC6A1FD0527200B9DCC8 /* DisplayUserErrorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayUserErrorTest.swift; sourceTree = "<group>"; };
    1.18  		15C5F2451F823752007DE086 /* SortedSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortedSet.swift; sourceTree = "<group>"; };
    1.19 @@ -1805,7 +1803,6 @@
    1.20  				43D755F51F262B37006F933A /* PantomimeError.swift */,
    1.21  				43A26FB91E0408FB00AF0B84 /* ServiceErrorProtocol.swift */,
    1.22  				155050F51FEAB082009CEAD2 /* ErrorContainer.swift */,
    1.23 -				15BBBC621FD0496800B9DCC8 /* ReportingErrorContainer.swift */,
    1.24  				155050F71FEAB57F009CEAD2 /* BackgroundError.swift */,
    1.25  			);
    1.26  			path = Error;
    1.27 @@ -3571,7 +3568,6 @@
    1.28  				43826F87212FF91D00BF1F7B /* Substring+Email.swift in Sources */,
    1.29  				152A39CE21905C3E00D9F8E4 /* ComposeHelpers.swift in Sources */,
    1.30  				43EC03481F4AE28F0026E152 /* String+Attachment.swift in Sources */,
    1.31 -				15BBBC631FD0496800B9DCC8 /* ReportingErrorContainer.swift in Sources */,
    1.32  				43985D0A2044296D0080FA9A /* OAuth2AuthViewModel.swift in Sources */,
    1.33  				150B8E981FCDACBB00374438 /* ErrorPropagator.swift in Sources */,
    1.34  				49691B1520D7FD0200CA9367 /* MessageViewModelConfigurable.swift in Sources */,
     2.1 --- a/pEpForiOS/Background/Error/ReportingErrorContainer.swift	Tue Feb 12 16:04:14 2019 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,29 +0,0 @@
     2.4 -//
     2.5 -//  ReportingErrorContainer.swift
     2.6 -//  pEp
     2.7 -//
     2.8 -//  Created by Andreas Buff on 30.11.17.
     2.9 -//  Copyright © 2017 p≡p Security S.A. All rights reserved.
    2.10 -//
    2.11 -
    2.12 -import Foundation
    2.13 -
    2.14 -/// Conform tho this if you want to get informed about errors reported to ReportingErrorContainer.
    2.15 -public protocol ReportingErrorContainerDelegate: class {
    2.16 -    func reportingErrorContainer(_ errorContainer: ReportingErrorContainer, didReceive error: Error)
    2.17 -}
    2.18 -
    2.19 -/// Same as ErrorContainer, but offers delegate that is informed in case of any reported error.
    2.20 -public class ReportingErrorContainer: ErrorContainer {
    2.21 -    weak public var delegate: ReportingErrorContainerDelegate?
    2.22 -
    2.23 -    public init(delegate: ReportingErrorContainerDelegate) {
    2.24 -        self.delegate = delegate
    2.25 -        super.init()
    2.26 -    }
    2.27 -
    2.28 -    override public func addError(_ error: Error) {
    2.29 -        super.addError(error)
    2.30 -        delegate?.reportingErrorContainer(self, didReceive: error)
    2.31 -    }
    2.32 -}