MCPcopy
hub / github.com/sveltejs/kit / handle_error

Function handle_error

packages/package/src/cli.js:8–17  ·  view source on GitHub ↗

@param {Error} error

(error)

Source from the content-addressed store, hash-verified

6
7/** @param {Error} error */
8function handle_error(error) {
9 if (error.name === 'SyntaxError') throw error;
10
11 console.error(colors.bold().red(`> ${error.message}`));
12 if (error.stack) {
13 console.error(colors.gray(error.stack.split('\n').slice(1).join('\n')));
14 }
15
16 process.exit(1);
17}
18
19const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
20const prog = sade('svelte-package', true).version(pkg.version);

Callers 1

cli.jsFile · 0.70

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected