a3230817faa86411b3dd846711efbad97752c270 angie Tue Jul 18 09:52:08 2023 -0700 Improved error message for non-bigDataUrl type specified with bigDataUrl=... instead of inline contents. refs #17455 diff --git src/hg/lib/customFactory.c src/hg/lib/customFactory.c index 69c1d38..1234f4a 100644 --- src/hg/lib/customFactory.c +++ src/hg/lib/customFactory.c @@ -4322,35 +4322,45 @@ "is missing its type setting.", bigDataUrl); continue; } else { char *fileName = lf->fileName; // Don't use bogus filename made up by lineFile when attached to memory block, // or placeholder for unknown file made up by customLineFile: if (startsWith(LF_BOGUS_FILE_PREFIX, lf->fileName) || sameString(CT_NO_FILE_NAME, lf->fileName)) fileName = "file"; errAbort("Unrecognized format line %d of %s:\n\t%s (note: chrom names are case sensitive, e.g.: correct: 'chr1', incorrect: 'Chr1', incorrect: '1')", lf->lineIx, fileName, emptyForNull(line)); } } + else if (bigDataUrl) + { +#define TYPE_NOT_BIGDATAURL "Type '%s' is not a bigDataUrl type. Please see the documentation links above." + if (lf) + lineFileAbort(lf, TYPE_NOT_BIGDATAURL, type); + else + errAbort(TYPE_NOT_BIGDATAURL, type); + } else { - errAbort("Unrecognized format type=%s line %d of %s", - (type? type : "NULL"), - (lf ? lf->lineIx : 0), (lf ? lf->fileName : "NULL file")); +#define TYPE_UNRECOGNIZED "Unrecognized format 'type=%s'. Please see the documentation links above." + if (lf) + lineFileAbort(lf, TYPE_UNRECOGNIZED, type); + else + errAbort(TYPE_UNRECOGNIZED, type); } } if (customFactoryParallelLoad(bigDataUrl, type) && (ptMax > 0)) // handle separately in parallel so long timeouts don't accrue serially // (unless ptMax == 0 which means turn parallel loading off) { if (doParallelLoad) { struct paraFetchData *pfd; AllocVar(pfd); pfd->track = track; // need pointer to be stable pfd->fac = fac; slAddHead(&pfdList, pfd); } oneList = track; }