From 07fb925ac60666187d0b6b9626a129f98ffca899 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 16 Oct 2024 22:38:36 +0700 Subject: [PATCH] beacon/engine: return formatted engine api error message and internal error in EngineAPIError.Error method --- beacon/engine/errors.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon/engine/errors.go b/beacon/engine/errors.go index 62773a0ea9..6c022cc999 100644 --- a/beacon/engine/errors.go +++ b/beacon/engine/errors.go @@ -17,6 +17,7 @@ package engine import ( + "fmt" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rpc" ) @@ -30,7 +31,7 @@ type EngineAPIError struct { } func (e *EngineAPIError) ErrorCode() int { return e.code } -func (e *EngineAPIError) Error() string { return e.msg } +func (e *EngineAPIError) Error() string { return fmt.Sprintf("msg: \"%s\". err: \"%w\"", e.msg, e.err) } func (e *EngineAPIError) ErrorData() interface{} { if e.err == nil { return nil