mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Give a more useful error message if attempting to drop an object that doesn't exist. Fixes #1154
This commit is contained in:
committed by
Dave Page
parent
d3d96d5c05
commit
166d42953c
@@ -430,6 +430,18 @@ class ResourceGroupView(NodeView):
|
||||
status, rgname = self.conn.execute_scalar(sql)
|
||||
if not status:
|
||||
return internal_server_error(errormsg=rgname)
|
||||
|
||||
if rgname is None:
|
||||
return make_json_response(
|
||||
success=0,
|
||||
errormsg=gettext(
|
||||
'Error: Object not found.'
|
||||
),
|
||||
info=gettext(
|
||||
'The specified resource group could not be found.\n'
|
||||
)
|
||||
)
|
||||
|
||||
# drop resource group
|
||||
sql = render_template("/".join([self.template_path, 'delete.sql']), rgname=rgname, conn=self.conn)
|
||||
status, res = self.conn.execute_scalar(sql)
|
||||
|
||||
Reference in New Issue
Block a user