Working code. Need to populate
This commit is contained in:
0
lib/__init__.py
Normal file
0
lib/__init__.py
Normal file
18
lib/utils.py
Normal file
18
lib/utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import NoReturn
|
||||
from PySide6.QtCore import QCoreApplication
|
||||
from PySide6.QtSql import QSqlQuery
|
||||
|
||||
|
||||
translate = QCoreApplication.translate
|
||||
def query_error(query: QSqlQuery) -> NoReturn:
|
||||
"""Standarized query error reporter."""
|
||||
print(
|
||||
translate("MainWindow", "SQL Error:\n")
|
||||
+ "{}\n{}\n{}:{}".format(
|
||||
query.executedQuery(),
|
||||
query.boundValues(),
|
||||
query.lastError().type(),
|
||||
query.lastError().text(),
|
||||
)
|
||||
)
|
||||
raise Exception(translate("MainWindow", "SQL Error"))
|
||||
Reference in New Issue
Block a user