Skip to content

$page.status 500 when using use:enahnce #8072

@KarolusD

Description

@KarolusD

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>

image

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.0

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions