MCPcopy
hub / github.com/sveltejs/svelte / get_error

Function get_error

packages/svelte/src/internal/shared/dev.js:9–28  ·  view source on GitHub ↗
(label)

Source from the content-addressed store, hash-verified

7 * @returns {Error & { stack: string } | null}
8 */
9export function get_error(label) {
10 const error = new Error();
11 const stack = get_stack();
12
13 if (stack.length === 0) {
14 return null;
15 }
16
17 stack.unshift('\n');
18
19 define_property(error, 'stack', {
20 value: stack.join('\n')
21 });
22
23 define_property(error, 'name', {
24 value: label
25 });
26
27 return /** @type {Error & { stack: string }} */ (error);
28}
29
30/**
31 * @returns {string[]}

Callers 6

getFunction · 0.90
proxyFunction · 0.90
sourceFunction · 0.90
internal_setFunction · 0.90
derivedFunction · 0.90
inspectFunction · 0.90

Calls 1

get_stackFunction · 0.85

Tested by

no test coverage detected