From f9044daba17ea996e199a211359f91a537a6404a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 6 Dec 2021 19:43:19 +0100 Subject: [PATCH] Check for writable database before starting --- CHANGELOG.md | 1 + run.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe3032..2f2b3bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project tries to adhere to [Semantic Versioning](https://semver.org/spe ### Fixed * Create missing PRAGMA values for Loop SQLite database, fixing failing import +* Check for database existing and able to connect to before doing any writing ## [0.3.1] - 2021-09-30 diff --git a/run.py b/run.py index 26e7e10..4456f1a 100755 --- a/run.py +++ b/run.py @@ -11,6 +11,9 @@ import sys def migrate(data: NomieImport): db = schema.migrate("output.db") + if not db: + raise ConnectionError + if data.trackers is not None: habitlist = habits.migrate(db, data.trackers)