From 9a4608b5d3008693461a778ec46d686e2acf693a Mon Sep 17 00:00:00 2001 From: Nick Johnson Date: Wed, 19 Oct 2016 12:57:42 +0100 Subject: [PATCH] cmd/evm: Print and exit instead of panicing --- cmd/evm/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/evm/main.go b/cmd/evm/main.go index c2acebe186..f06bbcfde4 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -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[:]))