diff --git a/pkg/core/state/notification_event.go b/pkg/core/state/notification_event.go index 06e77184a..87ea9dbb1 100644 --- a/pkg/core/state/notification_event.go +++ b/pkg/core/state/notification_event.go @@ -101,7 +101,7 @@ type notificationEventAux struct { func (ne NotificationEvent) MarshalJSON() ([]byte, error) { item, err := stackitem.ToJSONWithTypes(ne.Item) if err != nil { - item = []byte(`"error: recursive reference"`) + item = []byte(fmt.Sprintf(`"error: %v"`, err)) } return json.Marshal(¬ificationEventAux{ ScriptHash: ne.ScriptHash, @@ -191,12 +191,11 @@ type executionAux struct { // MarshalJSON implements implements json.Marshaler interface. func (e Execution) MarshalJSON() ([]byte, error) { - var errRecursive = []byte(`"error: recursive reference"`) arr := make([]json.RawMessage, len(e.Stack)) for i := range arr { data, err := stackitem.ToJSONWithTypes(e.Stack[i]) if err != nil { - data = errRecursive + data = []byte(fmt.Sprintf(`"error: %v"`, err)) } arr[i] = data } diff --git a/pkg/rpc/response/result/invoke.go b/pkg/rpc/response/result/invoke.go index cbd2740f0..83685a7ac 100644 --- a/pkg/rpc/response/result/invoke.go +++ b/pkg/rpc/response/result/invoke.go @@ -70,7 +70,7 @@ func (r Invoke) MarshalJSON() ([]byte, error) { for j := range iteratorValues { value[j], err = stackitem.ToJSONWithTypes(iteratorValues[j]) if err != nil { - st = []byte(`"error: recursive reference"`) + st = []byte(fmt.Sprintf(`"error: %v"`, err)) break } } @@ -85,7 +85,7 @@ func (r Invoke) MarshalJSON() ([]byte, error) { } else { data, err = stackitem.ToJSONWithTypes(r.Stack[i]) if err != nil { - st = []byte(`"error: recursive reference"`) + st = []byte(fmt.Sprintf(`"error: %v"`, err)) break } }