MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_error_msg

Function get_error_msg

web/pgadmin/misc/bgprocess/processes.py:49–66  ·  view source on GitHub ↗

This function is used to get the error message based on exit code.

(cmd, error_code)

Source from the content-addressed store, hash-verified

47
48
49def get_error_msg(cmd, error_code):
50 """
51 This function is used to get the error message based on exit code.
52 """
53 error_str = ''
54 # Get the Utility from the cmd.
55 for utility in UTILITIES_ARRAY:
56 if utility in cmd:
57 error_str = utility + _(': error: ')
58 break
59
60 try:
61 error_str = error_str + BG_PROCESS_ERROR_MSGS[error_code]
62 except KeyError:
63 error_str = (error_str + _('utility failed with exit code: ') +
64 str(error_code))
65
66 return error_str
67
68
69def get_current_time(format='%Y-%m-%d %H:%M:%S.%f %z'):

Callers 1

statusMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected