You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, would it be possible to always include resp.text in ResourceException.content? Specifically, when hasattr(resp, "reason") is true, the resp.text is not included in the exception which may omit valuable information.
Why?
I was setting up an Ansible playbook to automate the creation of a LXC container but kept running into the error:
Creation of lxc VM 100 failed with exception: 400 Bad Request: Parameter verification failed.
After some debugging I found the issue (invalid rootfs param). It turned out that the API was returning the detailed cause inside resp.text but that wasn't being included in the exception.
As such, always including resp.text in ResourceException.content can provide valuable information for quickly figuring out what is going wrong.
Proposed how
A simple solution would be to replace proxmoxer/core.py#L152 with resp.reason + " Specifically: " + resp.text,
The text was updated successfully, but these errors were encountered:
As the title says, would it be possible to always include
resp.text
inResourceException.content
? Specifically, when hasattr(resp, "reason") is true, theresp.text
is not included in the exception which may omit valuable information.Why?
I was setting up an Ansible playbook to automate the creation of a LXC container but kept running into the error:
After some debugging I found the issue (invalid rootfs param). It turned out that the API was returning the detailed cause inside
resp.text
but that wasn't being included in the exception.As such, always including
resp.text
inResourceException.content
can provide valuable information for quickly figuring out what is going wrong.Proposed how
A simple solution would be to replace proxmoxer/core.py#L152 with
resp.reason + " Specifically: " + resp.text,
The text was updated successfully, but these errors were encountered: