Skip to content

Commit 6593291

Browse files
authored
Proper error handling in PrismaAppRepository.findAppStore with Sentry logging (calcom#24212)
Signed-off-by: Parship Chowdhury <i.am.parship@gmail.com>
1 parent c48fb44 commit 6593291

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/features/apps/repository/PrismaAppRepository.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import { captureException } from "@sentry/nextjs";
2+
13
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
24
import { prisma } from "@calcom/prisma";
5+
import type { Prisma } from "@calcom/prisma/client";
36

47
export class PrismaAppRepository {
5-
static async seedApp(dirName: string, keys?: any) {
8+
static async seedApp(dirName: string, keys?: Prisma.InputJsonValue) {
69
const appMetadata = appStoreMetadata[dirName as keyof typeof appStoreMetadata];
710

811
if (!appMetadata) {
@@ -21,6 +24,11 @@ export class PrismaAppRepository {
2124
}
2225

2326
static async findAppStore() {
24-
return await prisma.app.findMany({ select: { slug: true } });
27+
try {
28+
return await prisma.app.findMany({ select: { slug: true } });
29+
} catch (error) {
30+
captureException(error);
31+
throw error;
32+
}
2533
}
2634
}

0 commit comments

Comments
 (0)