Show the actual error (for debugging) when using web3swift for RPC calls and it fails

pull/696/head
Hwee-Boon Yar 6 years ago
parent 8642496e92
commit 2f501326f4
  1. 2
      AlphaWallet/Tokens/Coordinators/GetBalanceCoordinator.swift
  2. 2
      AlphaWallet/Tokens/Coordinators/GetDecimalsCoordinator.swift
  3. 2
      AlphaWallet/Tokens/Coordinators/GetERC721BalanceCoordinator.swift
  4. 2
      AlphaWallet/Tokens/Coordinators/GetERC875BalanceCoordinator.swift
  5. 2
      AlphaWallet/Tokens/Coordinators/GetIsERC721ContractCoordinator.swift
  6. 2
      AlphaWallet/Tokens/Coordinators/GetIsERC875ContractCoordinator.swift
  7. 2
      AlphaWallet/Tokens/Coordinators/GetNameCoordinator.swift
  8. 2
      AlphaWallet/Tokens/Coordinators/GetSymbolCoordinator.swift

@ -54,7 +54,7 @@ class GetBalanceCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)(): \(error)"))))
}
}

@ -50,7 +50,7 @@ class GetDecimalsCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)(): \(error)"))))
}
}
}

@ -45,7 +45,7 @@ class GetERC721BalanceCoordinator {
let balances = self.adapt(balanceResult["0"])
completion(.success(balances))
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)(): \(error)"))))
}
}

@ -40,7 +40,7 @@ class GetERC875BalanceCoordinator {
let balances = self.adapt(balanceResult["0"])
completion(.success(balances))
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contractInstance).\(function.name)() of \(address.eip55String) as ERC875"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contractInstance).\(function.name)() of \(address.eip55String) as ERC875: \(error)"))))
}
}

@ -46,7 +46,7 @@ class GetIsERC721ContractCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)(): \(error)"))))
}
}
}

@ -44,7 +44,7 @@ class GetIsERC875ContractCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)(): \(error)"))))
}
}
}

@ -46,7 +46,7 @@ class GetNameCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)(): \(error)"))))
}
}
}

@ -45,7 +45,7 @@ class GetSymbolCoordinator {
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
}
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)()"))))
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(functionName)(): \(error)"))))
}
}
}

Loading…
Cancel
Save