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/getData.c src/hg/hubApi/getData.c index 0eefcdb..6a90351 100644 --- src/hg/hubApi/getData.c +++ src/hg/hubApi/getData.c @@ -78,35 +78,44 @@ { jsonWriteObjectStart(jw, NULL); int i = 0; for (i = 0; i < columnCount; ++i) jsonWriteString(jw, columnNames[i], row[i]); jsonWriteObjectEnd(jw); ++itemCount; } sqlFreeResult(&sr); jsonWriteListEnd(jw); } static struct bbiFile *bigFileOpen(char *trackType, char *bigDataUrl) { struct bbiFile *bbi = NULL; +struct errCatch *errCatch = errCatchNew(); +if (errCatchStart(errCatch)) + { if (startsWith("bigBed", trackType)) bbi = bigBedFileOpen(bigDataUrl); else if (startsWith("bigWig", trackType)) bbi = bigWigFileOpen(bigDataUrl); - + } +errCatchEnd(errCatch); +if (errCatch->gotError) + { + apiErrAbort("error opening bigFile URL: '%s', '%s'", bigDataUrl, errCatch->message->string); + } +errCatchFree(&errCatch); return bbi; } /* from hgTables.h */ struct sqlFieldType /* List field names and types */ { struct sqlFieldType *next; char *name; /* Name of field. */ char *type; /* Type of field (MySQL notion) */ }; /* from hgTables.c */ static struct sqlFieldType *sqlFieldTypeNew(char *name, char *type) /* Create a new sqlFieldType */