Skip to content

Commit 53afa99

Browse files
committed
fix: revert second console.error
1 parent 0161aa3 commit 53afa99

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

packages/svelte/src/internal/client/error-handling.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ function adjust_error(error, effect) {
6666
const message_descriptor = get_descriptor(error, 'message');
6767

6868
// if the message was already changed and it's not configurable we can't change it
69-
// or it will throw a different error swallowing the original one
69+
// or it will throw a different error swallowing the original error
70+
if (message_descriptor && !message_descriptor.configurable) return;
7071

7172
var indent = is_firefox ? ' ' : '\t';
7273
var component_stack = `\n${indent}in ${effect.fn?.name || '<unknown>'}`;
@@ -77,18 +78,9 @@ function adjust_error(error, effect) {
7778
context = context.p;
7879
}
7980

80-
if (!message_descriptor || message_descriptor.configurable) {
81-
define_property(error, 'message', {
82-
value: error.message + `\n${component_stack}\n`
83-
});
84-
} else {
85-
// eslint-disable-next-line no-console
86-
console.error(
87-
"The following it's not a separate error: we usually modify the error message to show you this information but `message` was non configurable so we print them in a separate log.\n" +
88-
error.message +
89-
`\n${component_stack}\n`
90-
);
91-
}
81+
define_property(error, 'message', {
82+
value: error.message + `\n${component_stack}\n`
83+
});
9284

9385
if (error.stack) {
9486
// Filter out internal modules

0 commit comments

Comments
 (0)