diff --git a/database.py b/database.py index 9003124..70fa506 100644 --- a/database.py +++ b/database.py @@ -16,7 +16,10 @@ class TextDB(Database): def __init__(self, filename): self.filename = filename def getCard(self, name): - return self.findCard(name).next() + try: + return self.findCard(name).next() + except: + raise Exception('Invalid card: {0}'.format(name)) def findCard(self, name=None): card = None with open(self.filename, 'r') as f: