Skip to content

Commit 32601a5

Browse files
msukkariclaude
andcommitted
fix(web): Remove redundant .catch() on createAudit calls
createAudit already catches errors internally and logs them with context, so the .catch(() => {}) at each call site was redundant. Removed from all 6 call sites: askCodebase, getFileSourceApi, getTreeApi, searchApi (x2), and listReposApi. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fcf446a commit 32601a5

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

packages/web/src/app/api/(server)/repos/listReposApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const listRepos = async ({ query, page, perPage, sort, direction, sourceO
1616
target: { id: org.id.toString(), type: 'org' },
1717
orgId: org.id,
1818
metadata: { source },
19-
}).catch(() => {});
19+
});
2020
}
2121

2222
const skip = (page - 1) * perPage;

packages/web/src/features/git/getFileSourceApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const getFileSource = async ({ path: filePath, repo: repoName, ref }: Fil
4242
target: { id: org.id.toString(), type: 'org' },
4343
orgId: org.id,
4444
metadata: { source },
45-
}).catch(() => {});
45+
});
4646
}
4747

4848
const repo = await prisma.repo.findFirst({

packages/web/src/features/git/getTreeApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const getTree = async ({ repoName, revisionName, paths }: GetTreeRequest,
3636
target: { id: org.id.toString(), type: 'org' },
3737
orgId: org.id,
3838
metadata: { source },
39-
}).catch(() => {});
39+
});
4040
}
4141

4242
const repo = await prisma.repo.findFirst({

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@ export const askCodebase = (params: AskCodebaseParams): Promise<AskCodebaseResul
9898
target: { id: org.id.toString(), type: 'org' },
9999
orgId: org.id,
100100
metadata: { source },
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-
});
109101
});
110102
}
111103

packages/web/src/features/search/searchApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const search = (request: SearchRequest) => sew(() =>
3838
target: { id: org.id.toString(), type: 'org' },
3939
orgId: org.id,
4040
metadata: { source },
41-
}).catch(() => {});
41+
});
4242
}
4343

4444
const repoSearchScope = await getAccessibleRepoNamesForUser({ user, prisma });
@@ -69,7 +69,7 @@ export const streamSearch = (request: SearchRequest) => sew(() =>
6969
target: { id: org.id.toString(), type: 'org' },
7070
orgId: org.id,
7171
metadata: { source },
72-
}).catch(() => {});
72+
});
7373
}
7474

7575
const repoSearchScope = await getAccessibleRepoNamesForUser({ user, prisma });

0 commit comments

Comments
 (0)