How to use next connect catch-all error handler with app router?
interface RequestContext {
params: { id: string }
}
const router = createEdgeRouter<NextRequest, RequestContext>()
where should I add the below to catch error
function onError(err, req, res) {
logger.log(err);
// OR: console.error(err);
res.status(500).end("Internal server error");
}