trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 678 forks source link

Investigate removal of potentially extraneous `catch` #3841

Open davidmurdoch opened 1 year ago

davidmurdoch commented 1 year ago
    Another "you didn't do it, but..."
const block = await blocks.get(number.toBuffer()).catch(_ => null);

The catch here might be extraneous, as we catch "NOTFOUND" exceptions in manager.ts https://github.com/trufflesuite/ganache/blob/3a74e07ea9a90ec7d6749cfad5703d679ba0dac1/src/chains/ethereum/ethereum/src/data-managers/manager.ts#L30

Do with that thought what you will.

_Originally posted by @jeffsmale90 in https://github.com/trufflesuite/ganache/pull/3470#discussion_r946310115_