91d7992f30d5756c352c83ff563405551dc64e1c
braney
  Tue Aug 16 16:37:01 2011 -0700
various changes concerning the soft-reset button for #4815
diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index 563095d..a6f36d4 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -126,31 +126,33 @@
 	{
 	// give people a chance to clear the error 
 	ourCellStart();
 	printf(
 	"<input name=\"hubClearButton\""
 	    "onClick=\"document.resetHubForm.elements['hubUrl'].value='%s';"
 		"document.resetHubForm.submit();return true;\" "
 		"class=\"hubField\" type=\"button\" value=\"clear error\">"
 		, hub->hubUrl);
 	ourCellEnd();
 	}
     ourPrintCell(hub->shortLabel);
     if (isEmpty(hub->errorMessage))
 	ourPrintCell(hub->longLabel);
     else
-	printf("<TD>ERROR: %s</TD>", hub->errorMessage);
+	printf("<TD><span class=\"hubError\">ERROR: %s</span>"
+	    "<a href=\"../goldenPath/help/hgTrackHubHelp.html#Debug\">Debug</a></TD>", 
+	    hub->errorMessage);
 
     ourPrintCell(hub->hubUrl);
 
     ourCellStart();
     printf(
     "<input name=\"hubDisconnectButton\""
 	"onClick=\"document.disconnectHubForm.elements['hubId'].value='%d';"
 	    "document.disconnectHubForm.submit();return true;\" "
 	    "class=\"hubField\" type=\"button\" value=\"X\">"
 	    , hub->id);
     ourCellEnd();
     }
 
 printf("</TR></tbody></TABLE>\n");
 printf("</div>");
@@ -250,31 +252,47 @@
     {
     printf("<div id=\"publicHubs\" class=\"hubList\"> \n");
     printf("No Public Track Hubs for this genome assembly<BR>");
     }
 
 printf("</div>");
 
 hDisconnectCentral(&conn);
 }
 
 static void doResetHub(struct cart *theCart)
 {
 char *url = cartOptionalString(cart, hgHubDataText);
 
 if (url != NULL)
-    hubResetError(url);
+    {
+    unsigned id = hubResetError(url);
+
+    /* try opening this again to reset error */
+    struct errCatch *errCatch = errCatchNew();
+    struct trackHub *tHub;
+    if (errCatchStart(errCatch))
+	tHub = trackHubFromId(theCart, id);
+    errCatchEnd(errCatch);
+    if (errCatch->gotError)
+	hubSetErrorMessage( errCatch->message->string, id);
+    else
+	hubSetErrorMessage(NULL, id);
+    errCatchFree(&errCatch);
+
+    tHub = NULL;
+    }
 else
     errAbort("must specify url in %s\n", hgHubDataText);
 }
 
 static void doClearHub(struct cart *theCart)
 {
 char *url = cartOptionalString(cart, hgHubDataText);
 
 printf("<pre>clearing hub %s\n",url);
 if (url != NULL)
     hubClearStatus(url);
 else
     errAbort("must specify url in %s\n", hgHubDataText);
 printf("<pre>Completed\n");
 }