Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en_US/release_notes_9_5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ Bug fixes
*********

| `Issue #6118 <https://github.com/pgadmin-org/pgadmin4/issues/6118>`_ - Improved PL/pgSQL code folding and support nested blocks.
| `Issue #7466 <https://github.com/pgadmin-org/pgadmin4/issues/7466>`_ - Fixed an issue where utilities such as pg_dump and pg_restore failed to log error messages when required dependency files were missing.
| `Issue #8032 <https://github.com/pgadmin-org/pgadmin4/issues/8032>`_ - Fixed an issue where the Schema Diff Tool incorrectly reported differences due to variations in the order of the privileges.
| `Issue #8691 <https://github.com/pgadmin-org/pgadmin4/issues/8691>`_ - Fixed an issue in the query tool where using multiple cursors to copy text resulted in only the first line being copied.
28 changes: 27 additions & 1 deletion web/pgadmin/misc/bgprocess/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

from pgadmin.utils import u_encode, file_quote, fs_encoding, \
get_complete_file_path, get_storage_directory, IS_WIN
from pgadmin.utils.constants import KERBEROS
from pgadmin.utils.constants import (KERBEROS, UTILITIES_ARRAY,
BG_PROCESS_ERROR_MSGS)
from pgadmin.utils.locker import ConnectionLocker
from pgadmin.utils.preferences import Preferences

Expand All @@ -45,6 +46,27 @@
PROCESS_NOT_FOUND = _("Could not find a process with the specified ID.")


def set_error_msg(cmd, error_code, stderr):
"""
This function is used to set the error message based on
exit code if stderr is empty.
"""
error_str = ''
# Get the Utility from the cmd.
for utility in UTILITIES_ARRAY:
if utility in cmd:
error_str = utility + _(': error: ')
break

try:
error_str = error_str + BG_PROCESS_ERROR_MSGS[error_code]
except KeyError:
error_str = (error_str + _('utility failed with exit code: ') +
str(error_code))

stderr.append([error_code, error_str])


def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):
"""
Generate the current time string in the given format.
Expand Down Expand Up @@ -608,6 +630,10 @@ def status(self, out=0, err=0):
'process_state': self.process_state
}

# Set error message based on exit code if stderr is empty.
if err_completed and len(stderr) == 0:
Comment thread
akshay-joshi marked this conversation as resolved.
Outdated
set_error_msg(self.cmd, self.ecode, stderr)
Comment thread
akshay-joshi marked this conversation as resolved.
Outdated

return {
'out': {
'pos': out,
Expand Down
8 changes: 7 additions & 1 deletion web/pgadmin/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@
]
}

UTILITIES_ARRAY = ['pg_dump', 'pg_dumpall', 'pg_restore', 'psql']
UTILITIES_ARRAY = ['pg_dumpall', 'pg_dump', 'pg_restore', 'psql']

BG_PROCESS_ERROR_MSGS = {
3221225781: gettext('Unable to find a dll needed by the utility. Ensuring '
Comment thread
akshay-joshi marked this conversation as resolved.
Outdated
'.dll files needed by the utility are in the same '
'folder as your executable.')
}

ENTER_EMAIL_ADDRESS = "Email address: "
USER_NOT_FOUND = gettext("The specified user ID (%s) could not be found.")
Expand Down