1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

remove fetchMehod()

This commit is contained in:
ClaudiaHolhos 2021-12-15 13:10:11 +02:00
parent e028dd9674
commit 62ced13eaf

View File

@ -54,19 +54,9 @@ export async function getFileInfo(
} }
} }
async function fetchMethod(url: string): Promise<Response> {
const result = await fetch(url)
if (!result) {
LoggerInstance.error(`Error requesting ${url}`)
LoggerInstance.error(`Response message: \n${result}`)
throw result
}
return result
}
export async function isValidProvider(url: string): Promise<boolean> { export async function isValidProvider(url: string): Promise<boolean> {
try { try {
const response = await ProviderInstance.isValidProvider(url, fetchMethod) const response = await ProviderInstance.isValidProvider(url, fetch)
return response return response
} catch (error) { } catch (error) {
console.error(`Error validating provider: ${error.message}`) console.error(`Error validating provider: ${error.message}`)