Skip to content

Commit ff2339e

Browse files
msukkariclaude
andcommitted
fix(web): Log audit failures instead of silently swallowing errors
Replace empty .catch(() => {}) on getAuditService().createAudit() in askCodebase with a handler that logs the error and audit context (action, actorId, orgId, source) for debugging and alerting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eb4d43c commit ff2339e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/web/src/features/mcp/askCodebase.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,15 @@ export const askCodebase = (params: AskCodebaseParams): Promise<AskCodebaseResul
9898
target: { id: org.id.toString(), type: 'org' },
9999
orgId: org.id,
100100
metadata: { source },
101-
}).catch(() => {});
101+
}).catch((error) => {
102+
logger.error('Failed to create audit log', {
103+
error,
104+
action: 'user.created_ask_chat',
105+
actorId: user.id,
106+
orgId: org.id,
107+
source,
108+
});
109+
});
102110
}
103111

104112
logger.debug(`Starting blocking agent for chat ${chat.id}`, {

0 commit comments

Comments
 (0)