diff --git a/pkg/core/mempool/mem_pool.go b/pkg/core/mempool/mem_pool.go index 47a9a8723..7e1bb98ef 100644 --- a/pkg/core/mempool/mem_pool.go +++ b/pkg/core/mempool/mem_pool.go @@ -22,7 +22,7 @@ var ( // ErrConflict is returned when transaction being added is incompatible // with the contents of the memory pool (Sender doesn't have enough GAS // to pay for all transactions in the pool). - ErrConflict = errors.New("conflicts with the memory pool") + ErrConflict = errors.New("conflicts: insufficient funds for all pooled tx") // ErrDup is returned when transaction being added is already present // in the memory pool. ErrDup = errors.New("already in the memory pool") diff --git a/pkg/rpc/response/errors.go b/pkg/rpc/response/errors.go index e19df1166..de0bf4057 100644 --- a/pkg/rpc/response/errors.go +++ b/pkg/rpc/response/errors.go @@ -90,6 +90,9 @@ func NewSubmitError(code int64, message string) *Error { // Error implements the error interface. func (e *Error) Error() string { + if e.Cause == nil { + return fmt.Sprintf("%s (%d) - %s", e.Message, e.Code, e.Data) + } return fmt.Sprintf("%s (%d) - %s - %s", e.Message, e.Code, e.Data, e.Cause) }