davidalber/Geneagrapher — Issue #16: Unpleasing error message for bad ID
Author: davidalber
Created: 2012-01-14 05:20:01+00:00
State: open
Labels: Bug

This was reported by ChaoJenWong.

ID `999999999` does not exist in the Mathematics Genealogy Project records. When a Geneagrapher request is made for the ID, it is preferable to have an informative and concise error message. When doing `ggrapher -v 999999999`, however, the response is:

Grabbing record #999999999...Traceback (most recent call last):
File "/Users/David/tmp/ggrapher/bin/ggrapher", line 9, in
load_entry_point('geneagrapher==1.0c2', 'console_scripts', 'ggrapher')()
File "/Users/David/fun/Geneagrapher/src/geneagrapher/geneagrapher.py", line 148, in ggrapher
ggrapher.build_graph()
File "/Users/David/fun/Geneagrapher/src/geneagrapher/geneagrapher.py", line 129, in build_graph
self.build_graph_complete(record_grabber, filename=self.cache_file)
File "/Users/David/fun/Geneagrapher/src/geneagrapher/geneagrapher.py", line 110, in build_graph_complete
descendant_queue=descendant_queue)
File "/Users/David/fun/Geneagrapher/src/geneagrapher/geneagrapher.py", line 84, in build_graph_portion
record = grabber.get_record(id)
File "/Users/David/fun/Geneagrapher/src/geneagrapher/cache_grabber.py", line 37, in get_record
record = self.grabber.get_record(id)
File "/Users/David/fun/Geneagrapher/src/geneagrapher/grabber.py", line 31, in get_record
return get_record_from_tree(soup, id)
File "/Users/David/fun/Geneagrapher/src/geneagrapher/grabber.py", line 40, in get_record_from_tree
raise ValueError(msg)
ValueError: Invalid id 999999999