from psycopg2 import ProgrammingError
from pgwui_common import auth_base_view
+from pgwui_core.exceptions import PGWUIError
from pgwui_core.core import (
UploadEngine,
- Error,
DataLineProcessor,
UploadDoubleTableForm,
TabularFileUploadHandler,
log = logging.getLogger(__name__)
-class NoTableError(Error):
+class NoTableError(PGWUIError):
'''No table uploaded'''
def __init__(self, e, descr='', detail=''):
super(NoTableError, self).__init__(e, descr, detail)
-class BadTableError(Error):
+class BadTableError(PGWUIError):
'''Supplied name does not work for a table or view'''
def __init__(self, e, descr='', detail=''):
super(BadTableError, self).__init__(e, descr, detail)
super(CannotInsertError, self).__init__(e, descr, detail)
-class BadHeadersError(Error):
+class BadHeadersError(PGWUIError):
'''The headers in the uploaded file are bad.'''
def __init__(self, e, descr='', detail=''):
super(BadHeadersError, self).__init__(e, descr, detail)
Validate input needed beyond that required to connect to the db.
Returns:
- A list of Error instances
+ A list of PGWUIError instances
'''
uf = self.uf
errors = super(TableUploadHandler, self).val_input()