src/hg/lib/customFactory.c 1.118

1.118 2010/03/15 21:32:49 angie
In bamLoader, report any warnings caught by errCatch even if there was no error.
Index: src/hg/lib/customFactory.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/customFactory.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -b -B -U 4 -r1.117 -r1.118
--- src/hg/lib/customFactory.c	15 Mar 2010 20:49:42 -0000	1.117
+++ src/hg/lib/customFactory.c	15 Mar 2010 21:32:49 -0000	1.118
@@ -1569,33 +1569,32 @@
 /* Process the bam track line. */
 {
 struct hash *settings = track->tdb->settingsHash;
 char *bigDataUrl = hashFindVal(settings, "bigDataUrl");
+struct dyString *dyErr = dyStringNew(0);
 if (bigDataUrl == NULL)
     errAbort("Missing bigDataUrl setting from track of type=bam (%s)", track->tdb->shortLabel);
 if (doExtraChecking)
     {
-    
     /* protect against temporary network error */
     struct errCatch *errCatch = errCatchNew();
     if (errCatchStart(errCatch))
 	{
 	if (!bamFileExists(bigDataUrl))
 	    {
-	    char errMsg[1024];
-            safef(errMsg, sizeof(errMsg), "Can't access %s's bigDataUrl %s and/or the associated index file %s.bai",
+            dyStringPrintf(dyErr,
+		       "Can't access %s's bigDataUrl %s and/or the associated index file %s.bai",
 		 track->tdb->shortLabel, bigDataUrl, bigDataUrl);
-	    track->networkErrMsg = cloneString(errMsg);
 	    }
 	}
     errCatchEnd(errCatch);
-    if (errCatch->gotError)
-	{
-	track->networkErrMsg = cloneString(errCatch->message->string);
-	}
+    if (isNotEmpty(errCatch->message->string))
+	dyStringPrintf(dyErr, ": %s", errCatch->message->string);
     errCatchFree(&errCatch);
     
     }
+if (isNotEmpty(dyErr->string))
+    track->networkErrMsg = dyStringCannibalize(&dyErr);
 return track;
 }
 
 static struct customFactory bamFactory =