You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, errors can be thrown with showErrorPage or throw createError() but sometimes, a soft error behavior (as described by @danielroe) is needed, it is better to practice to also set valid response code, even if not using error/404 pages.
As suggested by @atinux, it could be nice if we introduce a shortcut utility for useRequestEvent().res.statusCode = 404.
I suggest:
setResponseStatusCode(code: number)
Additional information
Would you be willing to help implement this feature?
Uh oh!
There was an error while loading. Please reload this page.
Describe the feature
Generally, errors can be thrown with
showErrorPage
orthrow createError()
but sometimes, a soft error behavior (as described by @danielroe) is needed, it is better to practice to also set valid response code, even if not using error/404 pages.As suggested by @atinux, it could be nice if we introduce a shortcut utility for
useRequestEvent().res.statusCode = 404
.I suggest:
Additional information
Final checks
The text was updated successfully, but these errors were encountered: