The base error class is now PGWUIError
authorKarl O. Pinc <kop@karlpinc.com>
Mon, 31 Aug 2020 20:46:17 +0000 (15:46 -0500)
committerKarl O. Pinc <kop@karlpinc.com>
Tue, 1 Sep 2020 13:24:47 +0000 (08:24 -0500)
src/pgwui_upload/views/upload.py

index ae4722ad98909938604fd10549ae0aa4147c3dd4..a0d63fa3ee6fb7271d00cd70828e8c5a5825f2da 100644 (file)
@@ -36,9 +36,9 @@ import psycopg2.errorcodes
 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,
@@ -51,13 +51,13 @@ from pgwui_core.core import (
 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)
@@ -81,7 +81,7 @@ class CannotInsertError(BadTableError):
         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)
@@ -139,7 +139,7 @@ class TableUploadHandler(TabularFileUploadHandler):
         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()