Catch error in a global middleware
i would like to send any unhandled error to sentry. to do that, i wrote the following code
unfortunately, in the case of server functions, the error seems to be handled by this code before my middleware
https://github.com/TanStack/router/blob/80a9f3dcdf70bb055821c7ab14117b8d77027e3f/packages/start-server-core/src/server-functions-handler.ts#L284
also, for some reason, the error message is sent to the frontend even when running in prod
can i somehow setup my error handler to work before/instead of server-functions-handler?