Changeset 4085

Show
Ignore:
Timestamp:
07/30/08 05:54:21 (4 months ago)
Author:
gotoh
Message:

Better error handling when specified report number is not found.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ticketboxmacro/0.11/TicketBox.py

    r4084 r4085  
    203203            try: 
    204204                curs.execute('SELECT query FROM report WHERE id=%s' % num) 
    205                 (sql,) = curs.fetchone() 
     205                rows = curs.fetchall() 
     206                if len(rows) == 0: 
     207                    raise Exception("No such report: %s"  % num) 
     208                sql = rows[0][0] 
    206209            finally: 
    207210                curs.close()