Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Internal improvement: Make source-fetcher throw on invalid network #3559

Merged
merged 4 commits into from
Nov 24, 2020

Conversation

haltman-at
Copy link
Contributor

@haltman-at haltman-at commented Nov 24, 2020

Note: This PR is a breaking change to @truffle/source-fetcher.

I realized that source-fetcher probably ought to throw if you give it an invalid network ID. So now it does. The isNetworkValid method is gone, because it's now unnecessary. Note obviously this required appropriate modifications to external.js.

Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from this one thing

packages/core/lib/debug/external.js Outdated Show resolved Hide resolved
@haltman-at
Copy link
Contributor Author

Actually wait I want to make another change to this too, you'll see it in a moment...

@haltman-at
Copy link
Contributor Author

OK, I fixed that, and also I exported the error so I can do a proper error check with instanceof instead of relying on error.name. For some reason I got the mistaken idea that would be somehow messy so didn't do that the first time around, but it's not.

Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants