Skip to content

Commit

Permalink
docs: fix code snippet (#13283)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Jan 7, 2025
1 parent 419ebfa commit 450ec48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions documentation/docs/30-advanced/25-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -67,7 +66,10 @@ declare global {
}
}
}
export {}

// @filename: index.js
import { error } from '@sveltejs/kit';
// ---cut---
error(404, {
message: 'Not found',
Expand Down

0 comments on commit 450ec48

Please sign in to comment.