Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading