'''The headers in the uploaded file are bad.'''
def __init__(self, e, descr='', detail=''):
super(BadHeadersError, self).__init__(e, descr, detail)
+
+
+class InsufficientPrivilegeError(SetupError):
+ '''The privileges are not sufficent to perform the requested operation'''
+ def __init__(self, e, descr='', detail=''):
+ super().__init__(e, descr, detail)
('<p>Hint: Check spelling, database permissions, '
' or try qualifying the'
' table name with a schema name</p>'))
+ elif pgcode == psycopg2.errorcodes.INSUFFICIENT_PRIVILEGE:
+ raise upload_ex.InsufficientPrivilegeError(
+ 'Your PostgreSQL login has insufficient privileges',
+ err.diag.message_primary)
else:
raise
return self.cur.fetchone()