feat(core): wrap audit log creation in try catch to prevent blocking APIs

This commit is contained in:
yiling
2026-08-01 15:50:35 +08:00
parent b0d8ecb589
commit fb66166b49
2 changed files with 24 additions and 9 deletions
@@ -75,4 +75,13 @@ describe('AuditLogService', () => {
expect(resultItem.total).toBe(2)
})
it('handles database errors gracefully and logs error without throwing', async () => {
const result = await auditLogService.logAction({
action: AuditAction.project_create,
teamId: 'invalid-non-existent-team-id',
})
expect(result).toBeNull()
})
})