From 12ac5b5b90bb1e7b561945052a37f4150114eea9 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 9 Nov 2023 11:41:51 +0300 Subject: [PATCH] fix overriden var --- eth/tracers/js/goja.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/tracers/js/goja.go b/eth/tracers/js/goja.go index 5ca3207861..07c138bae4 100644 --- a/eth/tracers/js/goja.go +++ b/eth/tracers/js/goja.go @@ -322,15 +322,15 @@ func (t *jsTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope // CaptureEnd is called after the call finishes to finalize the tracing. func (t *jsTracer) CaptureEnd(output []byte, gasUsed uint64, err error) { + if err != nil { + t.ctx["error"] = t.vm.ToValue(err.Error()) + } outputVal, err := t.toBuf(t.vm, output) if err != nil { t.err = err return } t.ctx["output"] = outputVal - if err != nil { - t.ctx["error"] = t.vm.ToValue(err.Error()) - } } // CaptureEnter is called when EVM enters a new scope (via call, create or selfdestruct).