fix: update error logging

This commit is contained in:
David Nguyen
2025-03-04 01:41:39 +11:00
parent e08d62c844
commit 7c38970ee8
4 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import { fetchRequestHandler } from '@ts-rest/serverless/fetch';
import { TsRestHttpError, fetchRequestHandler } from '@ts-rest/serverless/fetch';
import { Hono } from 'hono';
import { ApiContractV1 } from '@documenso/api/v1/contract';
@ -29,6 +29,12 @@ tsRestHonoApp.mount('/', async (request) => {
request,
contract: ApiContractV1,
router: ApiContractV1Implementation,
options: {},
options: {
errorHandler: (err) => {
if (err instanceof TsRestHttpError && err.statusCode === 500) {
console.error(err);
}
},
},
});
});