e The error severity
descr More description of the error
detail Extra HTML describing the error
- data The uploaded data
+ '''
+ def __init__(self, e, lineno, descr='', detail=''):
+ super().__init__(e, lineno, descr=descr, detail=detail)
+
+class ExecutionError(SQLError):
+ '''
+ Error raised when processing SQL
+
+ e The error severity
+ descr More description of the error
+ detail Extra HTML describing the error
'''
def __init__(self, e, lineno, descr='', detail=''):
super().__init__(f'{e} when executing SQL',
except psycopg.errors.Error as err:
lineno = stmt_text.count(
'\n', 0, int(err.diag.statement_position) - 1) + 1
- raise sql_ex.SQLError(err.diag.severity,
- lineno,
- descr=err.diag.message_primary,
- detail=self.format_detail(err, stmt_text))
+ raise sql_ex.ExecutionError(
+ err.diag.severity,
+ lineno,
+ descr=err.diag.message_primary,
+ detail=self.format_detail(err, stmt_text))
def get_result_rows(self, cur):
rows = []