diff --git a/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift b/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift index 960a0f84..873c7ebc 100644 --- a/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift +++ b/Sources/ShopifyCheckoutSheetKit/CheckoutWebViewController.swift @@ -213,13 +213,12 @@ extension CheckoutWebViewController: CheckoutWebViewDelegate { func checkoutViewDidFailWithError(error: CheckoutError) { CheckoutWebView.invalidate() + delegate?.checkoutDidFail(error: error) let shouldAttemptRecovery = delegate?.shouldRecoverFromError(error: error) ?? false if shouldAttemptRecovery { self.presentFallbackViewController(url: self.checkoutURL) - } else { - delegate?.checkoutDidFail(error: error) } } @@ -238,8 +237,4 @@ extension CheckoutWebViewController: CheckoutWebViewDelegate { func checkoutViewDidEmitWebPixelEvent(event: PixelEvent) { delegate?.checkoutDidEmitWebPixelEvent(event: event) } - - private func isErrorRecoverable(error: CheckoutError) -> Bool { - return error.isRecoverable - } }