def __init__(self, descr='', detail=''):
super().__init__('Error while formatting the download',
'', descr=descr, detail=detail)
+
+
+class MemoryError(SQLError):
+ '''
+ Error raised when we run out of memory generating on-screen results
+
+ descr More description of the error
+ detail Extra HTML describing the error
+ '''
+ def __init__(self,
+ descr=("Can't collect results for on-screen display"
+ '-- try downloading instead'),
+ detail=''):
+ super().__init__('Webserver out of memory',
+ '', descr=descr, detail=detail)
except csv.Error as ex:
raise sql_ex.CSVError(descr=f'The csv module reports: {ex}')
else:
- self.make_sql_results(cur)
+ try:
+ self.make_sql_results(cur)
+ except MemoryError:
+ self.sql_results = []
+ raise sql_ex.MemoryError()
def factory(self, ue):
'''Make a db loader function from an UploadEngine.