Skip to content

Commit

Permalink
Set raise error to DbError
Browse files Browse the repository at this point in the history
Thanks! Much more user-friendly.

Co-authored-by: Nyall Dawson <[email protected]>
  • Loading branch information
gisn8 and nyalldawson committed Oct 17, 2024
1 parent 92fcb86 commit 45d40ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/plugins/db_manager/db_plugins/postgis/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def createView(self, view, query):

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)
Expand Down

0 comments on commit 45d40ad

Please sign in to comment.