mirror of
https://github.com/proxmoxer/proxmoxer.git
synced 2026-04-25 07:06:00 +03:00
[PR #81] [MERGED] Fix display of API errors in ProxmoxResource._request #165
Labels
No labels
backend:https
backend:local
backend:openssh
backend:ssh_paramiko
pull-request
status:ansible-issue
status:help-wanted
status:info-needed
status:proxmox-issue
status:review-needed
type:bug 🐞
type:dependency ⛓️
type:docs 📝
type:enhancement ⏫
type:maintenance 🛠️
type:meta
type:question ❓
type:request ✋
type:testing 🧪
version:1.x
version:latest
version:py2
version:py3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmoxer#165
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/proxmoxer/proxmoxer/pull/81
Author: @m-rtijn
Created: 12/23/2021
Status: ✅ Merged
Merged: 12/23/2021
Merged by: @jhollowe
Base:
develop← Head:show-api-errors📝 Commits (1)
cbfddecShow API errors📊 Changes
2 files changed (+7 additions, -1 deletions)
View changed files
📝
proxmoxer/backends/https.py(+6 -0)📝
proxmoxer/core.py(+1 -1)📄 Description
While I was working on the Ansible proxmox module, which uses this API wrapper, I found that when you get a
400 Bad Request: Parameter verification failederror, the Proxmox API actually sends what is wrong with the parameters you send. However, proxmoxer does not add this information in theResourceException. Here is an example of the JSON with an error that is sent back by the Proxmox API (PVE v7.1-8):I found that this was because of the way
JsonSerializer.loadsworks. It always only sends thedatapart of the JSON back, which does not include the errors. Because I didn't want to affect other behaviour, I created a new method for sending the errors back. Obviously it is also possible to just change the wayJsonSerializer.loadsworks, but that will probably require changes elsewhere.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.