fix(machines): ensure machine details probe resolves

This commit is contained in:
Esdras Renan 2025-10-22 20:49:43 -03:00
parent 3fce36d4e5
commit 55316e51c6
2 changed files with 68 additions and 33 deletions

View file

@ -15,9 +15,11 @@ export async function GET(_req: NextRequest, ctx: { params: Promise<{ id: string
return NextResponse.json(data, { status: 200 })
} catch (err) {
if (err instanceof ConvexConfigurationError) {
console.error("[api] admin/machines/[id]/details configuration error", err)
return NextResponse.json({ error: err.message }, { status: 500 })
}
console.error("[api] admin/machines/[id]/details error", err)
return NextResponse.json({ error: "Internal error" }, { status: 500 })
const message = err instanceof Error && err.message ? err.message : "Internal error"
return NextResponse.json({ error: message }, { status: 500 })
}
}