4d72ed9554069edb885ff2f793add75e422a5459 hiram Thu Mar 21 15:58:39 2019 -0700 error catch aroung bbi file open and better sample getData links refs #18869 diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index e03035b..410a905 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -192,93 +192,101 @@ hashIncInt(countTracks, "superTrack child"); hashIncInt(countTracks, stripType); hashIncInt(countTracks, "track count"); } else if (isEmpty(tdb->type)) hashIncInt(countTracks, "no type specified"); else { hashIncInt(countTracks, stripType); hashIncInt(countTracks, "track count"); } freeMem(stripType); // showCounts(countTracks); } -static void sampleUrl(struct trackHub *hub, char *db, struct trackDb *tdb, char *chrom, long long chromSize) +static void sampleUrl(struct trackHub *hub, char *db, struct trackDb *tdb, char *chrom, long long chromSize, char *errorString) /* print out a sample getData URL */ { +char errorPrint[2048]; +errorPrint[0] = 0; + +if (isNotEmpty(errorString)) + { + safef(errorPrint, sizeof(errorPrint), " ERROR: %s", errorString); + } + unsigned start = chromSize / 4; unsigned end = start + 10000; if (end > chromSize) end = chromSize; char *genome = NULL; if (hub) genome = hub->genomeList->name; if (db) { if (hub) { if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); else - hPrintf("
  • %s : %s (sample getData)
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); } else { if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, db, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, db, chrom, tdb->track, start, end, errorPrint); else - hPrintf("
  • %s : %s (sample getData)
  • \n", tdb->track, tdb->type, urlPrefix, db, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, db, chrom, tdb->track, start, end, errorPrint); } } else if (hub) { if (tdb->parent) - hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s subtrack of parent: %s (sample getData)%s
  • \n", tdb->track, tdb->type, tdb->parent->track, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); else - hPrintf("
  • %s : %s (sample getData)
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end ); + hPrintf("
  • %s : %s (sample getData)%s
  • \n", tdb->track, tdb->type, urlPrefix, hub->url, genome, chrom, tdb->track, start, end, errorPrint); } else hPrintf("
  • %s : %s not db hub track ?
  • \n", tdb->track, tdb->type); } static void showSubTracks(struct trackHub *hub, char *db, struct trackDb *tdb, struct hash *countTracks, - char *chromName, long long chromSize) + char *chromName, long long chromSize, char *errorString) /* tdb has subtracks, show only subTracks, no details */ { hPrintf("
  • \n"); } static void trackSettings(struct trackDb *tdb, struct hash *countTracks) /* process the settingsHash for a trackDb, recursive when subtracks */ { hPrintf("