diff --git a/src/app/api/v1/sprint/attachment-counts/route.ts b/src/app/api/v1/sprint/attachment-counts/route.ts index 9b34937..9f12907 100644 --- a/src/app/api/v1/sprint/attachment-counts/route.ts +++ b/src/app/api/v1/sprint/attachment-counts/route.ts @@ -42,9 +42,14 @@ export async function GET(req: NextRequest) { let adminPb; try { adminPb = await getAdminPocketBase(); - } catch { + } catch (err) { + // Surface the real reason — the generic "PB admin unavailable" + // message was hiding the actual cause (missing env var, wrong + // password, PB unreachable from the prod container, etc.). + const reason = + err instanceof Error ? err.message : "unknown admin error"; return NextResponse.json( - { error: "PB admin unavailable" }, + { error: `PB admin unavailable: ${reason}` }, { status: 500 }, ); }