diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index 18393c3..8bfae57 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -165,10 +165,13 @@ def init_function(node_type, sid, did, scid, fid): # Function with return type "trigger" can not be debugged. if ":" in r_set['rows'][0]['name']: ret_status = False - elif r_set['rows'][0]['rettype'] == 'trigger': + msg = gettext("Functions with a colon in the name cannot be debug.") + elif node_type != 'trigger' and r_set['rows'][0]['rettype'] == 'trigger': ret_status = False + msg = gettext("Functions with return type trigger cannot be debug.") elif ppas_server and r_set['rows'][0]['prosrc'].lstrip().startswith('$__EDBwrapped__$'): ret_status = False + msg = gettext("EDB wrapperd functions cannot be debug.") else: # If user is super user then we should check debugger library is loaded or not if user['is_superuser']: @@ -177,9 +180,9 @@ def init_function(node_type, sid, did, scid, fid): return internal_server_error(gettext("Could not fetch debugger plugin information.")) # Need to check if plugin is really loaded or not with "plugin_debugger" string - if rid_pre: - if "plugin_debugger" not in rid_pre: - ret_status = False + if "plugin_debugger" not in rid_pre: + ret_status = False + msg = gettext("Debugger plugin path is not set in database configuration file") status_in, rid_tar = conn.execute_scalar( "SELECT count(*) FROM pg_proc WHERE proname = 'pldbg_get_target_info'") @@ -188,14 +191,16 @@ def init_function(node_type, sid, did, scid, fid): return internal_server_error(gettext("Could not fetch debugger target information.")) if rid_tar == 0: + msg = gettext("Could not fetch debugger target information.") ret_status = False else: ret_status = False + msg = gettext("Function/Procedure cannot be debug") # Return the response that function can not be debug... if not ret_status: - current_app.logger.debug(".Function/Procedure can not be debugged.") - return internal_server_error(gettext("Function/Procedure cannot be debugged.")) + current_app.logger.debug(msg) + return internal_server_error(msg) # Store the function information in session variable if 'funcData' not in session: diff --git a/web/pgadmin/tools/debugger/templates/debugger/js/debugger.js b/web/pgadmin/tools/debugger/templates/debugger/js/debugger.js index f16fa91..a68009d 100644 --- a/web/pgadmin/tools/debugger/templates/debugger/js/debugger.js +++ b/web/pgadmin/tools/debugger/templates/debugger/js/debugger.js @@ -316,7 +316,7 @@ define( try { var err = $.parseJSON(xhr.responseText); if (err.success == 0) { - Alertify.alert(err.errormsg); + Alertify.alert('Debugger Error', err.errormsg); } } catch (e) {} }