diff --git a/api/api_genome.go b/api/api_genome.go index 0b1a3c6..7abe6eb 100644 --- a/api/api_genome.go +++ b/api/api_genome.go @@ -91,7 +91,11 @@ func handleGenomeQuery(w http.ResponseWriter, r *http.Request) { extraction, err := lib.GenomeGetExtraction(sysCtx, dossierID) if err != nil { w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]string{"error": "no genome data for this dossier"}) + json.NewEncoder(w).Encode(map[string]interface{}{ + "error": "genome extraction entry not found", + "code": "GENOME_NO_EXTRACTION", + "detail": err.Error(), + }) return } @@ -130,7 +134,11 @@ func handleGenomeQuery(w http.ResponseWriter, r *http.Request) { variants, err := lib.GenomeGetVariants(sysCtx, dossierID, tierIDs) if err != nil { w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(GenomeResponse{Matches: []GenomeMatch{}, Returned: 0, Total: 0}) + json.NewEncoder(w).Encode(map[string]interface{}{ + "error": "failed to retrieve genome variants", + "code": "GENOME_VARIANT_QUERY_FAILED", + "detail": err.Error(), + }) return }