fix: add more logging for errors on sign or complete (#3151)

This commit is contained in:
Lucas Smith
2026-08-05 11:29:38 +10:00
committed by GitHub
parent 8bfcec8ee6
commit f0ab7c112e
2 changed files with 11 additions and 3 deletions
+7 -2
View File
@@ -636,9 +636,12 @@ export const fieldRouter = router({
// Log the error for debugging purposes.
ctx.logger.error({
message: 'Error signing field with token',
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : err,
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : String(err),
});
// Raw console.log incase we're somehow deailing with a funky error object that doesn't serialize well.
console.log('Error signing field with token', err);
// Rethrow the error so that the client receives the appropriate error response.
throw err;
}
@@ -668,9 +671,11 @@ export const fieldRouter = router({
// Log the error for debugging purposes.
ctx.logger.error({
message: 'Error removing signed field with token',
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : err,
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : String(err),
});
console.log('Error removing signed field with token', err);
// Rethrow the error so that the client receives the appropriate error response.
throw err;
}
@@ -636,9 +636,12 @@ export const recipientRouter = router({
// Log the error for debugging purposes.
ctx.logger.error({
message: 'Error completing document with token',
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : err,
error: err instanceof AppError ? `[${err.code}]: ${err.message}` : String(err),
});
// Raw console.log incase we're somehow dealing with a funky error object that doesn't serialize well.
console.log('Error completing document with token', err);
// Rethrow the error so that the client receives the appropriate error response.
throw err;
}