Mercurial > qqw
changeset 44:09c9efb2ca72
display parsing errors
| author | sheep@ghostwheel |
|---|---|
| date | Sun, 07 Mar 2010 18:27:07 +0100 |
| parents | e88249084d67 |
| children | afa24ecb0d45 |
| files | qqw.py |
| diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/qqw.py Sun Mar 07 18:25:23 2010 +0100 +++ b/qqw.py Sun Mar 07 18:27:07 2010 +0100 @@ -38,8 +38,8 @@ parser = ConfigParser.RawConfigParser() try: parser.readfp(StringIO.StringIO('\n'.join(lines))) - except: # XXX catch specific exceptions here - pass + except Exception, e: # XXX catch specific exceptions here + yield 'Parse error: %s' % e.message # MissingSectionHeaderError for section in parser.sections(): if len(section) == 1: @@ -59,8 +59,8 @@ </div></div><pre id="mapdef">""" try: yield parser.get('map', 'map') - except: # XXX catch specific exceptions here - pass + except Exception, e: # XXX catch specific exceptions here + yield "Can't display map: %s" % e.message yield """</pre><script>""" yield """var baseurl = '+download/';""" yield """var map_key = %s;""" % json.dumps(map_key)
