Skip to content

Commit 8752f90

Browse files
betegonclaude
andcommitted
refactor(init): drop redundant try/catch in detectSentry
handleLocalOp already wraps the entire switch in a try/catch, so the inner one was unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d026fdf commit 8752f90

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

src/lib/init/local-ops.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -795,25 +795,21 @@ export async function detectExistingProject(cwd: string): Promise<{
795795
async function detectSentry(
796796
payload: DetectSentryPayload
797797
): Promise<LocalOpResult> {
798-
try {
799-
const { detectDsn } = await import("../dsn/index.js");
800-
const dsn = await detectDsn(payload.cwd);
801-
802-
if (!dsn) {
803-
return { ok: true, data: { status: "none", signals: [] } };
804-
}
805-
806-
const signals = [
807-
`dsn: ${dsn.source}${dsn.sourcePath ? ` (${dsn.sourcePath})` : ""}`,
808-
];
798+
const { detectDsn } = await import("../dsn/index.js");
799+
const dsn = await detectDsn(payload.cwd);
809800

810-
return {
811-
ok: true,
812-
data: { status: "installed", signals, dsn: dsn.raw },
813-
};
814-
} catch {
801+
if (!dsn) {
815802
return { ok: true, data: { status: "none", signals: [] } };
816803
}
804+
805+
const signals = [
806+
`dsn: ${dsn.source}${dsn.sourcePath ? ` (${dsn.sourcePath})` : ""}`,
807+
];
808+
809+
return {
810+
ok: true,
811+
data: { status: "installed", signals, dsn: dsn.raw },
812+
};
817813
}
818814

819815
async function createSentryProject(

0 commit comments

Comments
 (0)