diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-01-08 21:27:51 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-01-08 21:27:51 +0100 |
commit | 7fb7ac3bc0986eb2e18a3179a695b081d92a19e6 (patch) | |
tree | f4ed5901afff765c5e9438a58165ec95cc778ce7 | |
parent | 9127f2a2736e085b40f160139b6ecbd6c6366a3b (diff) | |
download | psutil-7fb7ac3bc0986eb2e18a3179a695b081d92a19e6.tar.gz |
adjust error msgs
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
-rw-r--r-- | psutil/_psutil_osx.c | 8 | ||||
-rw-r--r-- | psutil/arch/osx/process_info.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/psutil/_psutil_osx.c b/psutil/_psutil_osx.c index b90ae496..173ef996 100644 --- a/psutil/_psutil_osx.c +++ b/psutil/_psutil_osx.c @@ -121,7 +121,7 @@ psutil_proc_list_fds(pid_t pid, int *num_fds) { errno = 0; ret = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, NULL, 0); if (ret <= 0) { - psutil_raise_for_pid(pid, "proc_pidinfo(PROC_PIDLISTFDS) 1 failed"); + psutil_raise_for_pid(pid, "proc_pidinfo(PROC_PIDLISTFDS) 1/2"); goto error; } @@ -131,7 +131,7 @@ psutil_proc_list_fds(pid_t pid, int *num_fds) { fds_size += PROC_PIDLISTFD_SIZE * 32; if (fds_size > max_size) { PyErr_Format(PyExc_RuntimeError, - "malloc() exceeded 24M limit"); + "prevent malloc() to allocate > 24M"); goto error; } } @@ -150,7 +150,7 @@ psutil_proc_list_fds(pid_t pid, int *num_fds) { errno = 0; ret = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fds_pointer, fds_size); if (ret <= 0) { - psutil_raise_for_pid(pid, "proc_pidinfo(PROC_PIDLISTFDS) 2 failed"); + psutil_raise_for_pid(pid, "proc_pidinfo(PROC_PIDLISTFDS) 2/2"); goto error; } @@ -856,7 +856,7 @@ psutil_proc_threads(PyObject *self, PyObject *args) { if (err != KERN_SUCCESS) { // errcode 4 is "invalid argument" (access denied) if (err == 4) { - AccessDenied("task_info"); + AccessDenied("task_info(TASK_BASIC_INFO)"); } else { // otherwise throw a runtime error with appropriate error code diff --git a/psutil/arch/osx/process_info.c b/psutil/arch/osx/process_info.c index eb75147d..6ab42750 100644 --- a/psutil/arch/osx/process_info.c +++ b/psutil/arch/osx/process_info.c @@ -380,7 +380,7 @@ psutil_proc_pidinfo(pid_t pid, int flavor, uint64_t arg, void *pti, int size) { ret = proc_pidinfo(pid, flavor, arg, pti, size); if (ret <= 0) { - psutil_raise_for_pid(pid, "proc_pidinfo() failed"); + psutil_raise_for_pid(pid, "proc_pidinfo()"); return 0; } if ((unsigned long)ret < sizeof(pti)) { |