8f399a09d7b39a87eadc3cc0a89c33598ddc5d2a chmalee Wed Apr 5 11:16:22 2023 -0700 First attempt at surfacing up hub errors when the requested hub database doesn't exist, refs #30832 diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index dcbbfdb..0af7a03 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -42,30 +42,31 @@ #include "bbiFile.h" #include "bPlusTree.h" #include "hgFind.h" #include "hubConnect.h" #include "trix.h" #include "vcf.h" #include "vcfUi.h" #include "htmshell.h" #include "bigBedFind.h" #include "customComposite.h" #include "interactUi.h" #include "bedTabix.h" #include "hic.h" #include "hui.h" #include "chromAlias.h" +#include "asmAlias.h" #ifdef USE_HAL #include "halBlockViz.h" #endif static struct hash *hubCladeHash; // mapping of clade name to hub pointer static struct hash *hubAssemblyHash; // mapping of assembly name to genome struct static struct hash *hubAssemblyUndecoratedHash; // mapping of undecorated assembly name to genome struct static struct hash *hubOrgHash; // mapping from organism name to hub pointer static struct trackHub *globalAssemblyHubList; // list of trackHubs in the user's cart static struct hash *trackHubHash; char *trackHubRelativeUrl(char *hubUrl, char *path) /* Return full path (in URL form if it's a remote hub) given * path possibly relative to hubUrl. Do a freeMem of result @@ -615,31 +616,36 @@ struct hash *ra; while ((ra = raNextRecord(lf)) != NULL) { // allow that trackDb+hub+genome is in one single file if (hashFindVal(ra, "hub")) continue; if (hashFindVal(ra, "track")) break; char *twoBitPath = hashFindVal(ra, "twoBitPath"); char *twoBitBptUrl = hashFindVal(ra, "twoBitBptUrl"); char *genome, *trackDb; if (twoBitPath != NULL) genome = addHubName(hashFindVal(ra, "genome"), hub->name); else + { genome = hashFindVal(ra, "genome"); + char *alias = asmAliasFind(genome); + if (!hDbExists(alias)) + errAbort("Error: non UCSC genome '%s' is defined without an associated twoBitPath. Please check the genomes.txt file stanzas", genome); + } if (hub->defaultDb == NULL) hub->defaultDb = genome; if (genome == NULL) badGenomeStanza(lf); if (hashLookup(hash, genome) != NULL) errAbort("Duplicate genome %s in stanza ending line %d of %s", genome, lf->lineIx, lf->fileName); if (singleFile == NULL) { trackDb = hashFindVal(ra, "trackDb"); if (trackDb == NULL) badGenomeStanza(lf); } else trackDb = singleFile;