From 45d40ad0711e6241cfbbb2c0c67106ebfff65700 Mon Sep 17 00:00:00 2001 From: gisn8 Date: Thu, 17 Oct 2024 07:52:45 -0400 Subject: [PATCH] Set raise error to DbError Thanks! Much more user-friendly. Co-authored-by: Nyall Dawson --- python/plugins/db_manager/db_plugins/postgis/connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/plugins/db_manager/db_plugins/postgis/connector.py b/python/plugins/db_manager/db_plugins/postgis/connector.py index a696316ef4c..afe4ae3fc3f 100644 --- a/python/plugins/db_manager/db_plugins/postgis/connector.py +++ b/python/plugins/db_manager/db_plugins/postgis/connector.py @@ -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)