Update OutOfDate message to show actual argument.

This commit is contained in:
Ethan Dalool 2020-01-27 20:00:08 -08:00
parent d12e66f19c
commit 24f155a40d
2 changed files with 6 additions and 2 deletions

View file

@ -17,7 +17,7 @@ class TimesearchException(Exception):
OUTOFDATE = '''
Database is out of date. {current} should be {new}.
Please use utilities\\database_upgrader.py
Please run utilities\\database_upgrader.py "{filepath.absolute_path}"
'''.strip()
class DatabaseOutOfDate(TimesearchException):
'''

View file

@ -219,7 +219,11 @@ class TSDB:
'''
existing = self.cur.execute('PRAGMA user_version').fetchone()[0]
if existing != DATABASE_VERSION:
raise exceptions.DatabaseOutOfDate(current=existing, new=DATABASE_VERSION)
raise exceptions.DatabaseOutOfDate(
current=existing,
new=DATABASE_VERSION,
filepath=self.filepath,
)
def _first_time_setup(self):
self.sql.executescript(DB_INIT)