From 59da61fecb2fc1711232127246d84e94dc147e4b Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 16 Aug 2026 01:29:58 +0530 Subject: [PATCH] fix(chrome): keep the message of an object console argument Claude-Session: https://claude.ai/code/session_01ShuAy8q8ZfPi8KHxwc8JpQ --- internal/driver/chrome/driver.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/internal/driver/chrome/driver.go b/internal/driver/chrome/driver.go index dfa177a..db51c01 100644 --- a/internal/driver/chrome/driver.go +++ b/internal/driver/chrome/driver.go @@ -70,13 +70,21 @@ func New() *Driver { } var parts []string for _, arg := range e.Args { - if arg.Value != nil { - var s string - if err := json.Unmarshal(arg.Value, &s); err == nil { - parts = append(parts, s) - } else { - parts = append(parts, string(arg.Value)) + // An object argument, which is what console.error(err) passes, + // carries no value at all: CDP sends a description instead. Reading + // only the value logged those calls with an empty message, so the + // entry named a level and nothing a reader could act on. + if arg.Value == nil { + if arg.Description != "" { + parts = append(parts, arg.Description) } + continue + } + var s string + if err := json.Unmarshal(arg.Value, &s); err == nil { + parts = append(parts, s) + } else { + parts = append(parts, string(arg.Value)) } } d.logsMu.Lock()