Skip to content
This repository was archived by the owner on Jun 12, 2024. It is now read-only.

Commit 18e6784

Browse files
committed
fix(cli): broken rpc urls
1 parent 2eb895d commit 18e6784

File tree

5 files changed

+605
-206
lines changed

5 files changed

+605
-206
lines changed

src/cli.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import dotenv from "dotenv";
66
import fs from "fs";
77
import path from "path";
88

9+
import { FetchError } from "./errors";
910
import { fetchSourcesAt } from "./fetch";
1011

1112
dotenv.config();
@@ -113,13 +114,13 @@ const fetchSources = () => {
113114
)
114115
);
115116
} catch (error: any) {
116-
console.log(
117-
colors.red(
118-
`Error while fetching sources for ${colors.bold(address)}: ${colors.bold(
119-
error.message
120-
)}`
121-
)
122-
);
117+
let base = `Error fetching sources for ${colors.bold(address)}`;
118+
if (error instanceof FetchError)
119+
base += ` from ${colors.underline(
120+
colors.bold(error.hostname)
121+
)} for chain with id ${colors.bold(error.chainId.toString())}`;
122+
123+
console.log(colors.red(`${base}: ${colors.bold(error.message)}`));
123124
}
124125
})
125126
);

0 commit comments

Comments
 (0)