mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 02:38:23 +00:00
feat(core): wrap audit log creation in try catch to prevent blocking APIs
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user