Skip to content

Commit e300102

Browse files
[BWA-155] refactor: Move ErrorReporter protocol to BitwardenKit (#1496)
1 parent 13f7f0f commit e300102

File tree

172 files changed

+221
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+221
-88
lines changed

Authenticator/Application/Services/ErrorReporter/CrashlyticsErrorReporter.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AuthenticatorShared
2+
import BitwardenKit
23
import FirebaseCore
34
import FirebaseCrashlytics
45

@@ -30,4 +31,18 @@ final class CrashlyticsErrorReporter: ErrorReporter {
3031

3132
Crashlytics.crashlytics().record(error: error)
3233
}
34+
35+
func setRegion(_ region: String, isPreAuth: Bool) {
36+
guard isEnabled else {
37+
return
38+
}
39+
Crashlytics.crashlytics().setCustomValue(region, forKey: isPreAuth ? "PreAuthRegion" : "Region")
40+
}
41+
42+
func setUserId(_ userId: String?) {
43+
guard isEnabled else {
44+
return
45+
}
46+
Crashlytics.crashlytics().setUserID(userId)
47+
}
3348
}

AuthenticatorBridgeKit/AuthenticatorBridgeDataStore.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import CoreData
23

34
// MARK: - AuthenticatorStoreType

AuthenticatorBridgeKit/ErrorReporter.swift

Lines changed: 0 additions & 16 deletions
This file was deleted.

AuthenticatorBridgeKit/Tests/AuthenticatorBridgeItemDataTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import BitwardenKit
2+
import BitwardenKitMocks
13
import Foundation
24
import XCTest
35

AuthenticatorBridgeKit/Tests/AuthenticatorBridgeItemServiceTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import BitwardenKit
2+
import BitwardenKitMocks
13
import Foundation
24
import XCTest
35

AuthenticatorBridgeKit/Tests/TestHelpers/MockErrorReporter.swift

Lines changed: 0 additions & 20 deletions
This file was deleted.

AuthenticatorShared/Core/Platform/Services/ClientService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import BitwardenSdk
23

34
/// A protocol for the service that handles common client functionality such as encryption and

AuthenticatorShared/Core/Platform/Services/ConfigService.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import Combine
23
import Foundation
34
import OSLog

AuthenticatorShared/Core/Platform/Services/ConfigServiceTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import BitwardenKit
2+
import BitwardenKitMocks
23
import XCTest
34

45
@testable import AuthenticatorShared

AuthenticatorShared/Core/Platform/Services/ErrorReporter/ErrorReporter.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)