mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
cmd/evm: Print and exit instead of panicing
This commit is contained in:
parent
5418d7267a
commit
9a4608b5d3
1 changed files with 4 additions and 2 deletions
|
|
@ -152,13 +152,15 @@ func run(ctx *cli.Context) error {
|
|||
var err error
|
||||
hexcode, err = ioutil.ReadFile(ctx.GlobalString(CodeFileFlag.Name))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
fmt.Println("Could not load code from file: %v", err)
|
||||
os.exit(1)
|
||||
}
|
||||
} else {
|
||||
var err error
|
||||
hexcode, err = ioutil.ReadAll(os.Stdin)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
fmt.Println("Could not load code from stdin: %v", err)
|
||||
os.exit(1)
|
||||
}
|
||||
}
|
||||
code = common.Hex2Bytes(string(hexcode[:]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue