aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/evm/json_logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/evm/json_logger.go')
-rw-r--r--cmd/evm/json_logger.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/evm/json_logger.go b/cmd/evm/json_logger.go
index d61981062..2cfeaa795 100644
--- a/cmd/evm/json_logger.go
+++ b/cmd/evm/json_logger.go
@@ -57,11 +57,15 @@ func (l *JSONLogger) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cos
}
// CaptureEnd is triggered at end of execution.
-func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration) error {
+func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error {
type endLog struct {
Output string `json:"output"`
GasUsed math.HexOrDecimal64 `json:"gasUsed"`
Time time.Duration `json:"time"`
+ Err string `json:"error,omitempty"`
}
- return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t})
+ if err != nil {
+ return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, err.Error()})
+ }
+ return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, ""})
}