diff --git a/LocalPackages/PixelKit/Sources/PixelKit/PixelKit.swift b/LocalPackages/PixelKit/Sources/PixelKit/PixelKit.swift index eec1e1332c..1a334f7908 100644 --- a/LocalPackages/PixelKit/Sources/PixelKit/PixelKit.swift +++ b/LocalPackages/PixelKit/Sources/PixelKit/PixelKit.swift @@ -279,12 +279,14 @@ public final class PixelKit { let newError: Error? - if let event = event as? PixelKitEventV2 { + if let event = event as? PixelKitEventV2, + let error = event.error { + // For v2 events we only consider the error specified in the event // and purposedly ignore the parameter in this call. // This is to encourage moving the error over to the protocol error // instead of still relying on the parameter of this call. - newError = event.error + newError = error } else { newError = error } diff --git a/LocalPackages/PixelKit/Sources/PixelKit/PixelKitEventV2.swift b/LocalPackages/PixelKit/Sources/PixelKit/PixelKitEventV2.swift index d6b2269afd..73da26d596 100644 --- a/LocalPackages/PixelKit/Sources/PixelKit/PixelKitEventV2.swift +++ b/LocalPackages/PixelKit/Sources/PixelKit/PixelKitEventV2.swift @@ -47,7 +47,6 @@ public protocol PixelFiring { frequency: PixelKit.Frequency) async throws -> Bool } - extension PixelKit: PixelFiring { @discardableResult public func fire(_ event: PixelKitEventV2) async throws -> Bool { diff --git a/LocalPackages/PixelKit/Sources/PixelKitTestingUtilities/PixelKitMock.swift b/LocalPackages/PixelKit/Sources/PixelKitTestingUtilities/PixelKitMock.swift index 108a4a63ad..df442748db 100644 --- a/LocalPackages/PixelKit/Sources/PixelKitTestingUtilities/PixelKitMock.swift +++ b/LocalPackages/PixelKit/Sources/PixelKitTestingUtilities/PixelKitMock.swift @@ -1,5 +1,5 @@ // -// PixelFireMock.swift +// PixelKitMock.swift // // Copyright © 2024 DuckDuckGo. All rights reserved. //