Commit a427111a authored by Mark Tyneway's avatar Mark Tyneway

op-chain-ops: improve error message

Improves the error message when reading a deploy config
to print the path. Will be helpful for CLI tooling that consumes
this function to give a better error message at runtime.
parent 3498ade5
...@@ -3,6 +3,7 @@ package genesis ...@@ -3,6 +3,7 @@ package genesis
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"math/big" "math/big"
"os" "os"
"path/filepath" "path/filepath"
...@@ -84,7 +85,7 @@ type DeployConfig struct { ...@@ -84,7 +85,7 @@ type DeployConfig struct {
func NewDeployConfig(path string) (*DeployConfig, error) { func NewDeployConfig(path string) (*DeployConfig, error) {
file, err := os.ReadFile(path) file, err := os.ReadFile(path)
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("deploy config at %s not found: %w", path, err)
} }
var config DeployConfig var config DeployConfig
......
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