Closed brillout closed 2 months ago
Using it as a Middleware or Handler? Currently a Handler MUST always return a Response to avoid undefined behavior.
It's for writing a universal handler for Vike: if there isn't any pages/_error
then it doesn't return a response. Quickly looking at the documentation I don't see the difference between middleware and handler, but let me have a closer look at the docs.
It's also needed for self-routing all the +middleware.
The standard approach (that still needs some documentation around it) for this use case would be to return an Error
for undefined behaviors.
Those undefined behaviors are ones that are server dependent, i.e. returning undefined
in an Express handler does not have the same meaning for Hono.
The following doesn't seem to work when the condition is false and no response is returned.
This error is thrown: