MutterCorp
MutterCorpNotice · Notícias
Programação·

Our audit logger is allowed to fail, and in production it fails without a sound

Our privacy policy says we "maintain a GDPR audit trail of privacy-related actions on your account". The code behind that sentence is one function, logAuditAction, and the most important thing about it is in its catch block. The shape export async function logAuditAction(params: AuditLogParams): Promise { try { await db.insert(auditLogsTable).values({ ... }); } catch (error) { // Log error but don't fail the main operation if (process.env.NODE_ENV === 'development') { console.error('Faile…

Publicado no Notice. Categoria: Programação.

Notícias sobre o mesmo assunto em outras fontes