Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a warning when the root load function failed. #9284

Closed
wvhulle opened this issue Mar 2, 2023 · 2 comments · Fixed by #9305
Closed

Give a warning when the root load function failed. #9284

wvhulle opened this issue Mar 2, 2023 · 2 comments · Fixed by #9305

Comments

@wvhulle
Copy link

wvhulle commented Mar 2, 2023

Describe the problem

Currently, the code in

return await server_fallback(url, { id: route.id }, error, status);
does not give a warning after form submission when an error is thrown in the load (using the kit version throw error(500, error)) but just refreshes the whole page and omits the error. It would be nice if the error was shown to be able to debug the application.

Describe the proposed solution

Add a log statement that is visible in dev and prints error.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

@Rich-Harris
Copy link
Member

By the nature of the solution (reloading the page) there isn't really a good place to print an error, since it will immediately vanish when the page reloads. I'm not sure what the right fix is — perhaps adding a debugger statement to prevent the reload?

@wvhulle
Copy link
Author

wvhulle commented Mar 8, 2023

Thanks a lot!

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 a pull request may close this issue.

2 participants