f788f52a37e301179d324c0d73d24570588e950c
max
  Fri May 26 16:57:00 2017 -0700
outputting a better error message when tables are missing, after a hgwbeta experience, refs #13634

diff --git src/hg/hgGeneGraph/hgGeneGraph src/hg/hgGeneGraph/hgGeneGraph
index b806434..03f4208 100755
--- src/hg/hgGeneGraph/hgGeneGraph
+++ src/hg/hgGeneGraph/hgGeneGraph
@@ -34,30 +34,32 @@
 from sys import exit
 from collections import defaultdict, namedtuple
 from os.path import *
 
 # import the UCSC-specific library
 sys.path.append("pyLib")
 try:
     from hgLib import cgiArgs, cgiSetup, cgiString, printContentType, printMenuBar, \
             sqlConnect, sqlQuery, errAbort, cfgOption, runCmd, cgiGetAll, printHgcHeader, \
             printHgcSection, webStartGbNoBanner, htmlPageEnd, hConnectCentral, sqlTableExists
 except:
     print("Content-type: text/html\n")
     print("Cannot find the directory cgi-bin/pyLib in Apache. This is an installation error.")
     print("All all parts of cgi-bin installed? Did you do 'make' in kent/src/hg/pyLib?")
 
+import MySQLdb
+
 # not using feedback button for now. Fan would have liked it, but not sure how we can write
 # to any form of database.
 #skimpyGimpyLoaded=False
 #try:
     #from skimpyGimpy import skimpyAPI
     #skimpyGimpyLoaded=True
 #except:
     #pass
 
 # the list of allowed chars in cgi args: digits, letters and dashes
 legalChars = set(string.digits)
 legalChars.update(set(string.letters))
 legalChars.update("_-./: ")
 
 # number of genes to show on graph by default
@@ -512,31 +514,34 @@
     # filter links
     filtLinks = {}
     for pair, pairData in links.iteritems():
         docCount, dbList, tagSet = pairData[:3]
         if len(showTags.intersection(tagSet))!=0:
             filtLinks[pair] = pairData
     return filtLinks
 
 def buildGraph(conn, gene, geneCount, minSupp, addNeighbors):
     """ get (gene,gene) links from database and annotate with weights and tags
     only get links with minSupp articles for each link  
     """
     if geneCount <= 1:
         errAbort("Sorry, you have to show at least two genes.")
 
+    try:
         links = queryLinks(conn, gene=gene)
+    except MySQLdb.Error:
+        errAbort("Cannot find the gg* tables in hgFixed. This mirror's database may need updating.")
 
     if len(links)==0:
         errAbort("Sorry, the gene %s is not a valid gene symbol or is not present in any gene interaction database." % cgi.escape(gene))
 
     links = filterLinks(links)
 
     lowLinks = defaultdict(set)
     graphLinks, lowLinks = splitHighLowLinks(links, gene, minSupp, lowLinks, geneCount)
 
     if addNeighbors:
         # create the links between all other genes, be less stringent about these
         otherGenes = set()
         for genes, pmids in graphLinks.iteritems():
             otherGenes.update(genes)
         if gene in otherGenes: