chore: add stack and cause to trpc error logging (#2033)

This commit is contained in:
Meier Lukas
2025-01-21 11:02:33 +01:00
committed by GitHub
parent b9271ba14a
commit e47d497560

View File

@@ -30,7 +30,9 @@ const handler = auth(async (req) => {
req,
createContext: () => createTRPCContext({ session: req.auth, headers: req.headers }),
onError({ error, path, type }) {
logger.error(`tRPC Error with ${type} on '${path}': (${error.code}) - ${error.message}`);
logger.error(
`tRPC Error with ${type} on '${path}': (${error.code}) - ${error.message}\n${error.stack}\n${error.cause}`,
);
},
});