3b070db77a829321ba062367c4860adb671ab743
braney
  Fri Oct 25 16:50:55 2024 -0700
put out a better error message if a hub-based assembly disappears.  Refs #34611

diff --git src/hg/lib/hubConnect.c src/hg/lib/hubConnect.c
index d12bc55..327a597 100644
--- src/hg/lib/hubConnect.c
+++ src/hg/lib/hubConnect.c
@@ -406,37 +406,44 @@
 return  val;
 }
 
 char *hubConnectSkipHubPrefix(char *trackName)
 /* Given something like "hub_123_myWig" return myWig.  Don't free this, it's not allocated */
 {
 if(!startsWith("hub_", trackName))
     return trackName;
 
 trackName += 4;
 trackName = strchr(trackName, '_');
 assert(trackName != NULL);
 return trackName + 1;
 }
 
-struct hubConnectStatus *hubFromId(unsigned hubId)
-/* Given a hub ID number, return corresponding trackHub structure. 
- * ErrAbort if there's a problem. */
+struct hubConnectStatus *hubFromIdNoAbort(unsigned hubId)
+/* Given a hub ID number, return corresponding trackHub structure. */
 {
 struct sqlConnection *conn = hConnectCentral();
 struct hubConnectStatus *status = hubConnectStatusForId(conn, hubId);
 hDisconnectCentral(&conn);
+return status;
+}
+
+struct hubConnectStatus *hubFromId(unsigned hubId)
+/* Given a hub ID number, return corresponding trackHub structure. 
+ * ErrAbort if there's a problem. */
+{
+struct hubConnectStatus *status = hubFromIdNoAbort(hubId);
 if (status == NULL)
     errAbort("The hubId %d was not found", hubId);
 if (!isEmpty(status->errorMessage))
     errAbort("%s", status->errorMessage);
 return status;
 }
 
 static struct trackDb *findSuperTrack(struct trackDb *tdbList, char *trackName)
 /*  discover any supertracks, and if there are some add them 
  *  to the subtrack list of the supertrack */
 {
 struct trackDb *tdb;
 struct trackDb *p = NULL;
 struct trackDb *next;