Commit 86bd6955 authored by Grant's avatar Grant
Browse files

catch errors in correct way

parent 8f1fd3b2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class SQLiteMixin:
            self.connection = sqlite3.connect(SQLiteMixin.DEFAULT_DB)
            self.connection.row_factory = (
                sqlite3.Row
            )  # Optional: This enables column access by name
            )  # This enables column access by name
            self.cursor = self.connection.cursor()
            self.logger.debug("Successfully opened connection to database and created cursor")
        except sqlite3.OperationalError as error:
@@ -50,8 +50,6 @@ class SQLiteMixin:
            return None
        except sqlite3.InterfaceError as error:
            self.logger.error(f"An unexpected InterfaceError occurred: {error}")
        except sqlite3.DatabaseError as error:
            self.logger.error(f"An unexpected DatabaseError occurred: {error}")
        except sqlite3.DataError as error:
            self.logger.error(f"An unexpected DataError occurred: {error}")
        except sqlite3.IntegrityError as error:
@@ -60,6 +58,8 @@ class SQLiteMixin:
            self.logger.error(f"An unexpected ProgrammingError occurred: {error}")
        except sqlite3.NotSupportedError as error:
            self.logger.error(f"An unexpected NotSupportedError occurred: {error}")
        except sqlite3.DatabaseError as error:
            self.logger.error(f"An unexpected DatabaseError occurred: {error}")
        except Exception as error:
            self.logger.error(
                "There was an undetermined issue with the query process: " + f" {error}"