Skip to content

feat: show message and stack trace in details when console.log'ging Error objects#902

Merged
szuend merged 2 commits intomainfrom
error-object-arguments
Feb 6, 2026
Merged

feat: show message and stack trace in details when console.log'ging Error objects#902
szuend merged 2 commits intomainfrom
error-object-arguments

Conversation

@szuend
Copy link
Contributor

@szuend szuend commented Feb 6, 2026

This PR improves the get_console_message tool when logging Error objects. We use the existing getExceptionDetails CDP command to retrieve the structured stack trace, we'll then source map.

Example:

try {
  compute();
} catch (e) {
  console.log('Compute failed', e);
}

Before:

### Arguments
Arg #0: Compute failed
Arg #1: {}

After:

### Arguments
Arg #0: Compute failed
Arg #1: ComputeError: Invariant violation
at compute (foo.ts:1:20)
at <anonymous> (main.ts:2:8)
Note: line and column numbers use 1-based indexing

@szuend szuend requested a review from OrKoN February 6, 2026 09:10
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
@szuend szuend added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit ffa00da Feb 6, 2026
31 of 33 checks passed
@szuend szuend deleted the error-object-arguments branch February 6, 2026 09:43
github-merge-queue bot pushed a commit that referenced this pull request Feb 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.17.0](chrome-devtools-mcp-v0.16.0...chrome-devtools-mcp-v0.17.0)
(2026-02-10)


### 🎉 Features

* include Error.cause chain for uncaught errors and logged Errors
([#906](#906))
([05b01ec](05b01ec))
* Integrate CrUX data into performance trace summaries
([#733](#733))
([b747f9d](b747f9d))
* show message and stack trace in details when console.log'ging Error
objects
([#902](#902))
([ffa00da](ffa00da))


### 🛠️ Fixes

* console formatter hides frames from ignored scripts
([#927](#927))
([8e2380b](8e2380b))
* limit stack traces to 50 lines
([#923](#923))
([caea23a](caea23a))


### 📄 Documentation

* add macOS Web Bluetooth troubleshooting note
([#930](#930))
([3c9528b](3c9528b)),
closes
[#917](#917)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
wolfib pushed a commit to wolfib/chrome-devtools-mcp that referenced this pull request Mar 10, 2026
…rror objects (ChromeDevTools#902)

This PR improves the `get_console_message` tool when logging `Error`
objects. We use the existing `getExceptionDetails` CDP command to
retrieve the structured stack trace, we'll then source map.

Example:

```js
try {
  compute();
} catch (e) {
  console.log('Compute failed', e);
}
```

Before:
```txt
### Arguments
Arg #0: Compute failed
Arg ChromeDevTools#1: {}
```

After:
```txt
### Arguments
Arg #0: Compute failed
Arg ChromeDevTools#1: ComputeError: Invariant violation
at compute (foo.ts:1:20)
at <anonymous> (main.ts:2:8)
Note: line and column numbers use 1-based indexing
```

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
wolfib pushed a commit to wolfib/chrome-devtools-mcp that referenced this pull request Mar 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.17.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v0.16.0...chrome-devtools-mcp-v0.17.0)
(2026-02-10)


### 🎉 Features

* include Error.cause chain for uncaught errors and logged Errors
([ChromeDevTools#906](ChromeDevTools#906))
([05b01ec](ChromeDevTools@05b01ec))
* Integrate CrUX data into performance trace summaries
([ChromeDevTools#733](ChromeDevTools#733))
([b747f9d](ChromeDevTools@b747f9d))
* show message and stack trace in details when console.log'ging Error
objects
([ChromeDevTools#902](ChromeDevTools#902))
([ffa00da](ChromeDevTools@ffa00da))


### 🛠️ Fixes

* console formatter hides frames from ignored scripts
([ChromeDevTools#927](ChromeDevTools#927))
([8e2380b](ChromeDevTools@8e2380b))
* limit stack traces to 50 lines
([ChromeDevTools#923](ChromeDevTools#923))
([caea23a](ChromeDevTools@caea23a))


### 📄 Documentation

* add macOS Web Bluetooth troubleshooting note
([ChromeDevTools#930](ChromeDevTools#930))
([3c9528b](ChromeDevTools@3c9528b)),
closes
[ChromeDevTools#917](ChromeDevTools#917)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants