Update exceptions
This commit is contained in:
parent
25a72b3002
commit
6912758a44
1 changed files with 4 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue