Skip to content

Commit

Permalink
remove references to 404 favouring client facing error
Browse files Browse the repository at this point in the history
  • Loading branch information
cianbuckley committed Oct 30, 2023
1 parent d1ef0b3 commit 178a52c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ extension MyViewController: ShopifyCheckoutDelegate {
/// You can inspect and log the Erorr and stacktrace to identify the problem.
case sdkError(underlying: Swift.Error)

/// Issued when the provided checkout URL results in a 404.
/// The SDK only supports stores migrated for extensibility. This can be an indicator that the store is still using checkout.liquid and needs to be migrated to extensibility
/// Issued when the provided checkout URL results in an error related to shop being on checkout.liquid.
/// The SDK only supports stores migrated for extensibility.
case sdkError(underlying: CheckoutLiquidError.unmigratedCheckout)

/// Unavailable error: checkout cannot be initiated or completed, e.g. due to network or server-side error
Expand Down
4 changes: 2 additions & 2 deletions Sources/ShopifyCheckout/CheckoutError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum CheckoutError: Swift.Error {
}

public enum CheckoutLiquidError: Swift.Error {
/// Issued when the provided checkout URL results in a 404.
/// The SDK only supports stores migrated for extensibility. This can be an indicator that the store is still using checkout.liquid and needs to be migrated to extensibility
/// Issued when the provided checkout URL results in an error related to shop being on checkout.liquid.
/// The SDK only supports stores migrated for extensibility.
case unmigratedCheckoutError(message: String)
}
2 changes: 1 addition & 1 deletion Sources/ShopifyCheckout/CheckoutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension CheckoutView: WKNavigationDelegate {
case 410:
viewDelegate?.checkoutViewDidFailWithError(error: .checkoutExpired(message: "Checkout has expired"))
case 404:
viewDelegate?.checkoutViewDidFailWithError(error: .sdkError(underlying: CheckoutLiquidError.unmigratedCheckoutError(message: "The checkout url provided has resulted in a 404. It may be possible that the provided checkout url is not valid. It is also possible the store is still using checkout.liquid. This checkout SDK only supports checkout with extensibility. Please ensure that the store is migrated to extensibility")))
viewDelegate?.checkoutViewDidFailWithError(error: .sdkError(underlying: CheckoutLiquidError.unmigratedCheckoutError(message: "The checkout url provided has resulted in an error. The store is still using checkout.liquid, whereas the checkout SDK only supports checkout with extensibility.")))
case 500:
viewDelegate?.checkoutViewDidFailWithError(error: .checkoutUnavailable(message: "Checkout unavailable due to error"))
default:
Expand Down

0 comments on commit 178a52c

Please sign in to comment.