c36458c5460d65ac3eda186e2659f1cbb2b6b695 hiram Thu Apr 11 13:53:21 2019 -0700 fixing up error returns refs #18869 diff --git src/hg/hubApi/list.c src/hg/hubApi/list.c index 0845678..402bffc 100644 --- src/hg/hubApi/list.c +++ src/hg/hubApi/list.c @@ -455,42 +455,42 @@ jsonWriteString(jw, "groups", el->groups); jsonWriteString(jw, "defaultPos", el->defaultPos); jsonWriteNumber(jw, "orderKey", el->orderKey); jsonWriteObjectEnd(jw); } jsonWriteObjectEnd(jw); apiFinishOutput(0, NULL, jw); } } else if (sameWord("tracks", words[1])) { char *hubUrl = cgiOptionalString("hubUrl"); char *genome = cgiOptionalString("genome"); char *db = cgiOptionalString("db"); if (isEmpty(hubUrl) && isEmpty(db)) - apiErrAbort(400, "Bad Request", "ERROR: must supply hubUrl or db name to return track list"); + apiErrAbort(400, "Bad Request", "ERROR: missing hubUrl or db name for endpoint /list/tracks"); if (isEmpty(hubUrl)) // missing hubUrl implies UCSC database { trackDbJsonOutput(db, stdout); // only need db for this function return; } if (isEmpty(genome) || isEmpty(hubUrl)) { if (isEmpty(genome)) - warn("# must supply genome='someName' the name of a genome in a hub for /list/tracks\n"); + apiErrAbort(400, "Bad Request", "ERROR: must supply genome='someName' the name of a genome in a hub for /list/tracks\n"); if (isEmpty(hubUrl)) - apiErrAbort(400, "Bad Request", "ERROR: must supply hubUrl='http:...' some URL to a hub for /list/genomes"); + apiErrAbort(400, "Bad Request", "ERROR: must supply hubUrl='http:...' some URL to a hub for /list/tracks"); } struct trackHub *hub = errCatchTrackHubOpen(hubUrl); if (hub->genomeList) { struct trackDb *tdbList = obtainTdb(hub->genomeList, NULL); slSort(tdbList, trackDbTrackCmp); struct jsonWrite *jw = apiStartOutput(); jsonWriteString(jw, "hubUrl", hubUrl); jsonWriteObjectStart(jw, genome); struct trackDb *el = NULL; for (el = tdbList; el != NULL; el = el->next ) { recursiveTrackList(jw, el); } jsonWriteObjectEnd(jw);