Commit 3aacbee5 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

Merge pull request #3253 from ethereum-optimism/fix/hh-handle-err

state-surgery: handle fs errors
parents 8323407f bbac0dfc
......@@ -67,7 +67,7 @@ func (h *Hardhat) init() error {
func (h *Hardhat) initDeployments() error {
for _, deploymentPath := range h.DeploymentPaths {
fileSystem := os.DirFS(filepath.Join(deploymentPath, h.network))
fs.WalkDir(fileSystem, ".", func(path string, d fs.DirEntry, err error) error {
err := fs.WalkDir(fileSystem, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
......@@ -95,6 +95,9 @@ func (h *Hardhat) initDeployments() error {
h.deployments = append(h.deployments, &deployment)
return nil
})
if err != nil {
return err
}
}
return nil
}
......@@ -104,7 +107,7 @@ func (h *Hardhat) initDeployments() error {
func (h *Hardhat) initArtifacts() error {
for _, artifactPath := range h.ArtifactPaths {
fileSystem := os.DirFS(artifactPath)
fs.WalkDir(fileSystem, ".", func(path string, d fs.DirEntry, err error) error {
err := fs.WalkDir(fileSystem, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
......@@ -130,6 +133,9 @@ func (h *Hardhat) initArtifacts() error {
h.artifacts = append(h.artifacts, &artifact)
return nil
})
if err != nil {
return err
}
}
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment