Skip to content

Commit

Permalink
Improve error message when URL is empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Apr 8, 2023
1 parent 5426f58 commit b8a9bcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hardhat-core/src/internal/core/providers/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider {
this._dispatcher = new ProxyAgent(process.env.http_proxy);
}
} catch (e) {
if (e instanceof TypeError && e.message === "Invalid URL") {
if (e instanceof TypeError && e.message === "Invalid URL: The provided URL is empty or undefined. Please provide a valid URL and try again.") {
e.message += ` ${url.origin}`;
}
// eslint-disable-next-line @nomiclabs/hardhat-internal-rules/only-hardhat-error
Expand Down

0 comments on commit b8a9bcb

Please sign in to comment.