From 450ec48a00cff46a76a00aec0c06785397caa262 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:33:50 +0100 Subject: [PATCH] docs: fix code snippet (#13283) --- documentation/docs/30-advanced/25-errors.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/documentation/docs/30-advanced/25-errors.md b/documentation/docs/30-advanced/25-errors.md index df05e5310232..17d7eabc8268 100644 --- a/documentation/docs/30-advanced/25-errors.md +++ b/documentation/docs/30-advanced/25-errors.md @@ -57,8 +57,7 @@ This throws an exception that SvelteKit catches, causing it to set the response You can add extra properties to the error object if needed... ```js -import { error } from '@sveltejs/kit'; - +// @filename: ambient.d.ts declare global { namespace App { interface Error { @@ -67,7 +66,10 @@ declare global { } } } +export {} +// @filename: index.js +import { error } from '@sveltejs/kit'; // ---cut--- error(404, { message: 'Not found',