make sure we always have an id (#3431)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-08-14 14:29:14 -07:00
committed by GitHub
parent e8fc6bc037
commit 5857684ebc

View File

@ -30,6 +30,15 @@ export async function submitTextToCadPrompt(
token
)
// Make sure we have an id.
if (data instanceof Error) {
return data
}
if (!data.id) {
return new Error('No id returned from Text-to-CAD API')
}
return data
}