Skip to content

Commit

Permalink
fix: remove thrown errors from mainquery (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
daviroo authored Jun 21, 2022
1 parent a052344 commit a9a7ac2
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions app/hooks/use-main-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ const useMainQuery = (): useMainQueryOutput => {
crashlytics().recordError(e)
console.debug(e)
})
throw new Error(
"Error occurred during main query execution prior to cache population. Unable to confirm if data necessary for proper execution of the app is present.",
)
}
if (error.networkError && previousData) {
// Call to mainquery has failed but we have data in the cache
Expand All @@ -43,9 +40,6 @@ const useMainQuery = (): useMainQueryOutput => {
// This is the first execution of mainquery and it has failed
crashlytics().recordError(error.networkError)
// TODO: check if error is INVALID_AUTHENTICATION here
// throw new Error(
// "Did not receive a response from main query. Either the network is offline or servers are not responding.",
// )
}
}
const userPreferredLanguage = data?.me?.language
Expand All @@ -55,13 +49,6 @@ const useMainQuery = (): useMainQueryOutput => {
const btcWallet = wallets?.find((wallet) => wallet?.__typename === "BTCWallet")
const usdWallet = wallets?.find((wallet) => wallet?.__typename === "UsdWallet")

if (hasToken && !btcWallet && !loading) {
// User is logged in but no wallet was returned. We need a BTC wallet for the app to function.
throw new Error(
"Did not receive a BTC wallet for the default account. Unable to load application data.",
)
}

const btcWalletBalance = btcWallet?.balance
const usdWalletBalance = usdWallet?.balance ?? 0
const btcWalletId = btcWallet?.id
Expand Down

0 comments on commit a9a7ac2

Please sign in to comment.