Skip to content

Commit ab91807

Browse files
committed
fix: remove unneded IPFS request catch
1 parent 2a5acfa commit ab91807

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

src/index.ts

+19-22
Original file line numberDiff line numberDiff line change
@@ -194,28 +194,25 @@ async function catchupAndWatchChain(
194194

195195
chainLogger.trace(`Fetching ${url}`);
196196

197-
try {
198-
const res = await fetch(url, {
199-
timeout: 2000,
200-
onRetry(cause) {
201-
chainLogger.debug(`Retrying IPFS request ${String(cause)}`);
202-
},
203-
retry: { retries: 3, minTimeout: 2000, maxTimeout: 60 * 10000 },
204-
// IPFS data is immutable, we can rely entirely on the cache when present
205-
cache: "force-cache",
206-
cachePath:
207-
config.cacheDir !== null
208-
? path.join(config.cacheDir, "ipfs")
209-
: undefined,
210-
});
211-
212-
return (await res.json()) as T;
213-
} catch (err) {
214-
chainLogger.warn({
215-
msg: "failed to load IPFS file",
216-
err,
217-
});
218-
}
197+
const res = await fetch(url, {
198+
timeout: 2000,
199+
onRetry(cause) {
200+
chainLogger.debug({
201+
msg: "Retrying IPFS request",
202+
url: url,
203+
err: cause,
204+
});
205+
},
206+
retry: { retries: 3, minTimeout: 2000, maxTimeout: 60 * 10000 },
207+
// IPFS data is immutable, we can rely entirely on the cache when present
208+
cache: "force-cache",
209+
cachePath:
210+
config.cacheDir !== null
211+
? path.join(config.cacheDir, "ipfs")
212+
: undefined,
213+
});
214+
215+
return (await res.json()) as T;
219216
};
220217

221218
await rpcProvider.getNetwork();

0 commit comments

Comments
 (0)