diff --git a/packages/features/doctor/src/lib/server/services/doctor-analysis.service.ts b/packages/features/doctor/src/lib/server/services/doctor-analysis.service.ts index 29d24d8..983241d 100644 --- a/packages/features/doctor/src/lib/server/services/doctor-analysis.service.ts +++ b/packages/features/doctor/src/lib/server/services/doctor-analysis.service.ts @@ -404,8 +404,14 @@ export async function getAnalysisResultsForDoctor( const medusaOrderId = firstAnalysisResponse?.analysis_responses?.analysis_order?.medusa_order_id; - if (!analysisResponsesData?.length || !userId || !medusaOrderId) { - throw new Error('Failed to retrieve full analysis data.'); + if (!analysisResponsesData?.length) { + throw new Error('No analysis responses data found.'); + } + if (!userId) { + throw new Error('No user id found.'); + } + if (!medusaOrderId) { + throw new Error('No medusa order id found.'); } const responseElementAnalysisElementOriginalIds = analysisResponsesData.map(