222992ee5c992c1ba25babcb8736eadb5ad0366c
braney
  Thu Nov 20 18:07:58 2014 -0800
when hubs disappear out from under us, put out a kindler, gentler errormessage that gives people a clue what's happened.   #14365

diff --git src/hg/lib/hubConnect.c src/hg/lib/hubConnect.c
index 6d3df05..fc8059a 100644
--- src/hg/lib/hubConnect.c
+++ src/hg/lib/hubConnect.c
@@ -162,50 +162,51 @@
  * has an error status.  Default time to wait is 30 minutes, but this
  * is configurable with the hub.timeToCheck conf variable */
 {
 char *checkTimeString = cfgOptionDefault(hgHubConnectTimeToCheck, "1800");
 time_t checkTime = sqlUnsigned(checkTimeString);
 return dateIsOlderBy(notOkStatus, "%F %T", checkTime);
 }
 
 /* Given a hub ID return associated status. Returns NULL if no such hub.  If hub
  * exists but has problems will return with errorMessage field filled in. */
 struct hubConnectStatus *hubConnectStatusForId(struct sqlConnection *conn, int id)
 {
 struct hubConnectStatus *hub = NULL;
 char query[1024];
 sqlSafef(query, sizeof(query), 
-    "select hubUrl,status, errorMessage,lastNotOkTime from %s where id=%d", getHubStatusTableName(), id);
+    "select hubUrl,status, errorMessage,lastNotOkTime, shortLabel from %s where id=%d", getHubStatusTableName(), id);
 struct sqlResult *sr = sqlGetResult(conn, query);
 char **row = sqlNextRow(sr);
 if (row != NULL)
     {
     AllocVar(hub);
     hub->id = id;
     hub->hubUrl = cloneString(row[0]);
     hub->status = sqlUnsigned(row[1]);
     hub->errorMessage = cloneString(row[2]);
+    char *shortLabel = row[4];
 
     if (isEmpty(row[2]) || hubTimeToCheck(hub, row[3]))
 	{
 	char *errorMessage = NULL;
 	hub->trackHub = fetchHub( hub, &errorMessage);
 	hub->errorMessage = cloneString(errorMessage);
 	hubUpdateStatus( hub->errorMessage, hub);
 	if (!isEmpty(hub->errorMessage))
 	    {
-	    warn("%s", hub->errorMessage);
+	    warn("Could not connect to hub \"%s\": %s", shortLabel, hub->errorMessage);
 	    }
 	}
     }
 sqlFreeResult(&sr);
 return hub;
 }
 
 struct hubConnectStatus *hubConnectStatusListFromCartAll(struct cart *cart)
 /* Return list of all track hubs that are referenced by cart. */
 {
 struct hubConnectStatus *hubList = NULL, *hub;
 struct slPair *pair, *pairList = cartVarsWithPrefix(cart, hgHubConnectHubVarPrefix);
 struct sqlConnection *conn = hConnectCentral();
 for (pair = pairList; pair != NULL; pair = pair->next)
     {