Skip to content

Commit 776df8a

Browse files
committed
cmd/evm: return json error if unmarshalling from stdin fails
1 parent addd882 commit 776df8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/evm/internal/t8ntool/transition.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ func Main(ctx *cli.Context) error {
142142
// Figure out the prestate alloc
143143
if allocStr == stdinSelector || envStr == stdinSelector || txStr == stdinSelector {
144144
decoder := json.NewDecoder(os.Stdin)
145-
decoder.Decode(inputData)
145+
if err := decoder.Decode(inputData); err != nil {
146+
return NewError(ErrorJson, fmt.Errorf("failed unmarshaling stdin: %v", err))
147+
}
146148
}
147149
if allocStr != stdinSelector {
148150
inFile, err := os.Open(allocStr)

0 commit comments

Comments
 (0)