Skip to content

migration part 2 - #2165

Draft
Rich-Harris wants to merge 1 commit into
migrationfrom
migration-clanker
Draft

migration part 2#2165
Rich-Harris wants to merge 1 commit into
migrationfrom
migration-clanker

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

Stacked on #2164 — this is what my agent (OpenCode with 5.6 Sol) did with the instructions

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
next-svelte-dev Ready Ready Preview Aug 11, 2026 11:42pm
svelte-dev Ready Ready Preview Aug 11, 2026 11:42pm

@@ -1,3 +1,2 @@
export function handleError() {
return { message: 'Internal Error' }; // the default implementation of this hook

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't really matter given that this exercise isn't active (it has the xx) but removing this was overzealous, it should probably be reinstated

```

You could also call your error reporting service in these hooks.
Returning nothing for other error kinds preserves SvelteKit's safe default. You could also call your error reporting service for unexpected errors in these hooks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wording is kinda bad, it implies that if you behave differently it isn't safe

Suggested change
Returning nothing for other error kinds preserves SvelteKit's safe default. You could also call your error reporting service for unexpected errors in these hooks.
Returning nothing for other error kinds preserves SvelteKit's safe default. You could also call your error reporting service for unexpected errors in these hooks.

Comment on lines +1 to +5
export function handleError({ kind, error }) {
if (kind === 'unknown') {
console.error(error);
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tutorial exercise needs revisiting, it's out of date at present

The `handleError` hook lets you intercept errors and trigger some behaviour, like pinging a Slack channel or sending data to an error logging service. The `kind` property distinguishes expected application errors, framework errors, validation errors and unexpected errors.

As you'll recall from an [earlier exercise](error-basics), an error is _unexpected_ if it wasn't created with the `error` helper from `@sveltejs/kit`. It generally means something in your app needs fixing. The default behaviour is to log the error:
As you'll recall from an [earlier exercise](error-basics), an error is _unexpected_ if it wasn't created with the `error` helper from `@sveltejs/kit`. It generally means something in your app needs fixing. We can log only unexpected errors like this:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this stuff is out of date, we don't use 'expected' vs 'unexpected' terminology any more

url.searchParams.delete('show');

replaceState(url, {});
goto(url, { shallow: true, replace: true, state: {} });

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #2164 (comment)

but also, are there two occurrences here and it only caught one?

url.searchParams.set('version', v);

replaceState(url, {});
goto(url, { shallow: true, replace: true, state: {} });

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant