Skip to content

Commit

Permalink
add try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Sep 11, 2023
1 parent 49546fd commit d316977
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions commands/foundry.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@ module.exports = {
return activeChains;
},
async forkChains(options) {
// await module.exports.installFoundry(options.foundryCommit);
log('starting to fork chains');
try {
// await module.exports.installFoundry(options.foundryCommit);

if (typeof options === 'object') {
const chains = await module.exports.runAnvilWithViem(
options.chainsToFork,
);
if (typeof options === 'object') {
const chains = await module.exports.runAnvilWithViem(
options.chainsToFork,
);

return { chains };
} else if (typeof options === 'string') {
if (isNaN(options)) {
// todo: add support for:
// (multiple) network IDs
// (single) network name
// (multiple) network names
} else {
// todo: add support for:
// (single) network ID
return { chains };
} else if (typeof options === 'string') {
if (isNaN(options)) {
// todo: add support for:
// (multiple) network IDs
// (single) network name
// (multiple) network names
} else {
// todo: add support for:
// (single) network ID
}
}
} catch (e) {
throw new Error('Error while forking chains', e);
}
},
async setupViem(anvilChainType) {
Expand Down

0 comments on commit d316977

Please sign in to comment.