4a5d2dbd54249e247fb49728e5fc9c598cb37efb
angie
  Fri Jan 11 11:29:12 2019 -0800
If it appears that the user tried to upload custom track data as a session, then give them a link to hgCustom.  refs #22638

diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c
index 91170e8..9fb0097 100644
--- src/hg/hgSession/hgSession.c
+++ src/hg/hgSession/hgSession.c
@@ -1323,31 +1323,41 @@
         {
         dyStringAppend(dyMessage, dyLoadMessage->string);
         cartCopyCustomComposites(cart);
         hubConnectLoadHubs(cart);
         cartCopyCustomTracks(cart);
         cartHideDefaultTracks(cart);
         cartCheckForCustomTracks(cart, dyMessage);
         }
     else
         {
         dyStringClear(dyMessage);
         dyStringAppend(dyMessage, "<span style='color: red;'><b>"
                        "Unable to load session: </b></span>");
         dyStringAppend(dyMessage, dyLoadMessage->string);
         dyStringAppend(dyMessage, "The uploaded file needs to have been previously saved from the "
-                       "<b>Save Settings</b> section.  If you feel you have reached this "
+                       "<b>Save Settings</b> section.\n");
+        // Looking for the words "custom track" in an error string is hokey, returning an enum
+        // from cartLoadSettings would be better, but IMO that isn't worth a big refactoring.
+        if (stringIn("custom track", dyLoadMessage->string))
+            {
+            dyStringPrintf(dyMessage, "If you would like to upload a custom track, please use the "
+                           "<a href='%s?%s'>"
+                           "Custom Tracks</a> tool.\n",
+                           hgCustomName(), cartSidUrlString(cart));
+            }
+        dyStringAppend(dyMessage, "If you feel you have reached this "
                        "message in error, please contact the "
                        "<A HREF=\"mailto:genome-www@soe.ucsc.edu?subject=Session file upload failed&"
                        "body=Hello Genome Browser team,%0AMy session file failed to upload. "
                        "The error message was:%0A");
         dyStringAppend(dyMessage, cgiEncodeFull(dyLoadMessage->string));
         dyStringAppend(dyMessage, "%0ACan you help me upload the data?\">"
                        "UCSC Genome Browser team</A> for assistance.\n");
         }
     dyStringFree(&dyLoadMessage);
     }
 return dyStringCannibalize(&dyMessage);
 }
 
 void renamePrefixedCartVar(char *prefix, char *oldName, char *newName)
 /* If cart has prefix+oldName, replace it with prefix+newName = submit. */