//#region src/nitro-v3/middleware.d.ts /** * Server middleware handler that catches MxllogError and returns a structured JSON response. * * Frameworks like TanStack Start catch thrown errors before Nitro's error handler, * stripping the `data` field (containing `why`, `fix`, `link`). This middleware * intercepts MxllogErrors first, attaches them to the wide event, and throws a * `Response` that the framework passes through directly. * * @example TanStack Start * ```ts * import { createMiddleware } from '@tanstack/react-start' * import { mxllogErrorHandler } from '@safaricom-mxl/log/nitro/v3' * * const mxllogMiddleware = createMiddleware().server(mxllogErrorHandler) * * export const Route = createRootRoute({ * server: { middleware: [mxllogMiddleware] }, * }) * ``` */ declare function mxllogErrorHandler(next: (...args: any[]) => Promise): Promise; //#endregion export { mxllogErrorHandler }; //# sourceMappingURL=middleware.d.mts.map