Throw an appropriate error when a table for which View/Edit data is open is deleted and query is executed. #6138
parent
e2c5d9a916
commit
a6faa77e5b
|
|
@ -12,7 +12,8 @@
|
|||
"""
|
||||
|
||||
from flask import render_template
|
||||
from pgadmin.utils.exception import ExecuteError
|
||||
from flask_babel import gettext
|
||||
from pgadmin.utils.exception import ExecuteError, ObjectGone
|
||||
|
||||
|
||||
def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids):
|
||||
|
|
@ -25,6 +26,10 @@ def get_columns_types(is_query_tool, columns_info, table_oid, conn, has_oids):
|
|||
)
|
||||
|
||||
colst, rset = conn.execute_2darray(query)
|
||||
# If no record found consider table is deleted, raise error
|
||||
if len(rset['rows']) == 0:
|
||||
raise ObjectGone(gettext("The specified object could not be found."))
|
||||
|
||||
if not colst:
|
||||
raise ExecuteError(rset)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue