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
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Is your feature request related to a problem? Please describe.
All errors originating in server routes are currently sent as a text response by Sapper and there is no way to prevent this. This might cause to leak some information which should not happen on production. It also requires somehow boilerplate-ish code in every server route if you need to either log the error or to format it in some other way (e.g. formulating a JSON response).
Describe the solution you'd like
An option to provide a function to handle server route errors in a centralised way.
Describe alternatives you've considered
Injecting express/polka middleware before or after Sapper's cannot solve this problem, because Sapper handles server routing internally in its middleware, catches and handles all errors inside.
How important is this feature to you?
I believe it's critical for any real-world production deployment to be able to control what happens with errors. You usually need to log them and you need to control the output sent to the browser. At least, it is critical to me.
Additional context
I created a patch for this and will submit a pull request in a moment.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
All errors originating in server routes are currently sent as a text response by Sapper and there is no way to prevent this. This might cause to leak some information which should not happen on production. It also requires somehow boilerplate-ish code in every server route if you need to either log the error or to format it in some other way (e.g. formulating a JSON response).
Describe the solution you'd like
An option to provide a function to handle server route errors in a centralised way.
Describe alternatives you've considered
Injecting express/polka middleware before or after Sapper's cannot solve this problem, because Sapper handles server routing internally in its middleware, catches and handles all errors inside.
How important is this feature to you?
I believe it's critical for any real-world production deployment to be able to control what happens with errors. You usually need to log them and you need to control the output sent to the browser. At least, it is critical to me.
Additional context
I created a patch for this and will submit a pull request in a moment.
The text was updated successfully, but these errors were encountered: