dr-rodriguez / AstrodbWeb

A web application for accessing the BDNYC SQL database
MIT License
0 stars 2 forks source link

Null result returns error #1

Closed hover2pi closed 8 years ago

hover2pi commented 8 years ago

If the query returns nothing but the SQL was legit, it should maybe return '0 records found' or something rather than an error.

dr-rodriguez commented 8 years ago

Technically it does, but the problem is that a mistyped query returns the same result (ie, null) as a good query with no objects. Perhaps the best way is to change astrodbkit so that if the query is mistyped it raises an AttributeError rather than print out 'could not execute query'. We could then catch this error and treat it separately from a null result.

dr-rodriguez commented 8 years ago

Updated error handling to treat incorrect SQL queries differently from null results by grabbing the printed output error message.