3d00d8348e1cb6eafec60cc3d7321f6de7e669be braney Mon Dec 12 13:09:49 2022 -0800 be smarter about showing the user error messages diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index b7ac5b6..8553c53 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -1035,31 +1035,40 @@ } hashFree(&hash); } static void validateTracks( struct trackHub *hub, struct trackHubGenome *genome, struct trackDb *tdbList) /* Make sure a hub track list has the right settings and its parents exist. */ { // mark the containers by setting their subtracks pointer markContainers(hub, genome, tdbList); /* Loop through list checking tags */ struct trackDb *tdb; for (tdb = tdbList; tdb != NULL; tdb = tdb->next) { + struct errCatch *errCatch = errCatchNew(); + if (errCatchStart(errCatch)) + { validateOneTrack(hub, genome, tdb); + } + errCatchEnd(errCatch); + if (errCatch->gotError) + { + tdb->errMessage = cloneString(errCatch->message->string); + } // clear these two pointers which we set in markContainers tdb->subtracks = NULL; tdb->parent = NULL; } } struct trackDb *trackHubTracksForGenome(struct trackHub *hub, struct trackHubGenome *genome, struct dyString *incFiles) /* Get list of tracks associated with genome. Check that it only is composed of legal * types. Do a few other quick checks to catch errors early. If incFiles is not NULL, * put the list of included files in there. */ { struct lineFile *lf = udcWrapShortLineFile(genome->trackDbFile, NULL, MAX_HUB_TRACKDB_FILE_SIZE); struct trackDb *tdbList = trackDbFromOpenRa(lf, NULL, incFiles); lineFileClose(&lf);