-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
Describe the bug
use:enhance always returns $page.status 500 after throwing whatever error() in page endpoint
Reproduction
https://github.com/KarolusD/sveltekit-error-status/tree/main/src/routes
page endpoint:
export const actions: Actions = {
default: () => {
throw error(400, { code: 400, message: 'hey' });
}
};
results in throwing 500 page status in +error.svelte page
<h1>{$page.status}</h1>
<p>{$page?.error?.message}</p>
<p>{$page?.error?.code}</p>
Logs
No response
System Info
System:
OS: macOS 12.0.1
CPU: (8) arm64 Apple M1 Pro
Memory: 338.30 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.8.0 - /opt/homebrew/bin/node
Yarn: 1.22.18 - /opt/homebrew/bin/yarn
npm: 8.18.0 - /opt/homebrew/bin/npm
Browsers:
Chrome: 108.0.5359.98
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.90
@sveltejs/kit: next => 1.0.0-next.581
svelte: ^3.54.0 => 3.54.0
vite: ^4.0.0 => 4.0.0Severity
annoyance
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels
