migration part 2 - #2165
Draft
Rich-Harris wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Rich-Harris
commented
Aug 11, 2026
| @@ -1,3 +1,2 @@ | |||
| export function handleError() { | |||
| return { message: 'Internal Error' }; // the default implementation of this hook | |||
Member
Author
There was a problem hiding this comment.
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
Rich-Harris
commented
Aug 11, 2026
| ``` | ||
|
|
||
| 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. |
Member
Author
There was a problem hiding this comment.
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. |
Rich-Harris
commented
Aug 11, 2026
Comment on lines
+1
to
+5
| export function handleError({ kind, error }) { | ||
| if (kind === 'unknown') { | ||
| console.error(error); | ||
| } | ||
| } |
Member
Author
There was a problem hiding this comment.
the tutorial exercise needs revisiting, it's out of date at present
Rich-Harris
commented
Aug 11, 2026
| 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: |
Member
Author
There was a problem hiding this comment.
this stuff is out of date, we don't use 'expected' vs 'unexpected' terminology any more
Rich-Harris
commented
Aug 12, 2026
| url.searchParams.delete('show'); | ||
|
|
||
| replaceState(url, {}); | ||
| goto(url, { shallow: true, replace: true, state: {} }); |
Member
Author
There was a problem hiding this comment.
see #2164 (comment)
but also, are there two occurrences here and it only caught one?
Rich-Harris
commented
Aug 12, 2026
| url.searchParams.set('version', v); | ||
|
|
||
| replaceState(url, {}); | ||
| goto(url, { shallow: true, replace: true, state: {} }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2164 — this is what my agent (OpenCode with 5.6 Sol) did with the instructions