From 6912758a440d921587b0b542fffc25b058780f99 Mon Sep 17 00:00:00 2001 From: VD15 Date: Mon, 26 May 2025 20:53:04 +0100 Subject: [PATCH] Update exceptions --- setup_db.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup_db.py b/setup_db.py index e247386..075c3cf 100644 --- a/setup_db.py +++ b/setup_db.py @@ -1,14 +1,15 @@ import sqlite3 +import traceback import os import argparse from configparser import ConfigParser from typing import List, Tuple class DBNotFoundError(Exception): - pass + '''Could not find the database location''' class InvalidMigrationError(Exception): - pass + '''Migration file has an invalid name''' def get_migrations() -> List[Tuple[int, str]] | InvalidMigrationError: '''Returns a list of migration files in numeric order.''' @@ -91,6 +92,7 @@ def main(): conn.commit() except Exception as ex: print(f'An error occurred while applying migration: {ex}, aborting...') + print(traceback.format_exc()) conn.rollback() break conn.close()