Skip to content

Commit

Permalink
Use LookupError for key lookup failures rather than ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 14, 2014
1 parent a041595 commit de0d8c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def getStation(self, name):
return self.stations[self.systemIDs[upperName]]
elif upperName in self.stationIDs:
return self.stations[self.stationIDs[upperName]]
raise ValueError("Unrecognized system/station name '%s'" % name)
raise LookupError("Unrecognized system/station name '%s'" % name)

def query(self, sql):
conn = pypyodbc.connect(self.path)
Expand All @@ -226,5 +226,5 @@ def list_search(self, listType, lookup, values):
listType, lookup, match, val))
match = val
if not match:
raise ValueError("Error: '%s' doesn't match any %s" % (lookup, listType))
raise LookupError("Error: '%s' doesn't match any %s" % (lookup, listType))
return match

0 comments on commit de0d8c7

Please sign in to comment.