Skip to content

Commit 10fe70f

Browse files
committed
fix: wrap $inspect error logging in console.group
1 parent e01bd97 commit 10fe70f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/odd-dancers-sleep.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: wrap `$inspect` error logging in `console.group`

packages/svelte/src/internal/client/dev/inspect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ export function inspect(get_value, inspector = console.log) {
2424
try {
2525
value = get_value();
2626
} catch (error) {
27-
// eslint-disable-next-line no-console
27+
/* eslint-disable no-console */
28+
console.group(`an error occurred when reading values inside an \`$inspect\`: `);
2829
console.error(error);
30+
console.groupEnd();
31+
/* eslint-enable no-console */
2932
}
3033

3134
if (value !== UNINITIALIZED) {

0 commit comments

Comments
 (0)