LayerZero-Labs / LayerZero-v1

An Omnichain Interoperability Protocol
Other
1.96k stars 1.25k forks source link

Error handling getAddresses.js #40

Open tudorpintea999 opened 1 year ago

tudorpintea999 commented 1 year ago

Hello, I added an error handling there

Error Handling in getAddressForNetwork:

The getAddressForNetwork function does not handle the error object provided by fs.readFile. If an error occurs (e.g., the file does not exist or there are permission issues), it should be handled properly, and the promise should be rejected. The check if (content == undefined) should also check for null and should ideally use the strict equality operator ===. However, this check should be part of the error handling for the error object.