Set raise error to DbError

Thanks! Much more user-friendly.

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
This commit is contained in:
gisn8 2024-10-17 07:52:45 -04:00 committed by Nyall Dawson
parent 92fcb86be6
commit 45d40ad071

View File

@ -1018,7 +1018,7 @@ class PostGisDBConnector(DBConnector):
if len(view_name_parts) > 2:
# Raise an error when more than one period is used.
raise ValueError("Invalid view name: Please use the format 'schema.viewname', or enter only the viewname for the public schema.")
raise DbError("Invalid view name: Please use the format 'schema.viewname', or enter only the viewname for the public schema.")
elif len(view_name_parts) == 2: # To allow view creation into specified schema
schema, view_name = view_name_parts
sql = "CREATE VIEW %s AS %s" % (self.quoteId([schema, view_name]), query)