[PR #242] [MERGED] client: handle nil response/body on task errors #335

Closed
opened 2026-02-28 00:41:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/242
Author: @lbajolet-hashicorp
Created: 3/8/2023
Status: Merged
Merged: 3/18/2023
Merged by: @mleone87

Base: masterHead: handle_task_error_panic_fix


📝 Commits (1)

  • 6fe7346 client: handle nil response/body on task errors

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 proxmox/client.go (+6 -0)

📄 Description

As with CreateQemuVm, sometimes the HandleTaskError function panics on a nil deferencement error when the reponse or the body is nil.

To avoid this, we only read/close the body when it is available, and fallback to a generic error string otherwise.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/242 **Author:** [@lbajolet-hashicorp](https://github.com/lbajolet-hashicorp) **Created:** 3/8/2023 **Status:** ✅ Merged **Merged:** 3/18/2023 **Merged by:** [@mleone87](https://github.com/mleone87) **Base:** `master` ← **Head:** `handle_task_error_panic_fix` --- ### 📝 Commits (1) - [`6fe7346`](https://github.com/Telmate/proxmox-api-go/commit/6fe734668c0d66dc12172d3355d76445d627cecd) client: handle nil response/body on task errors ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/client.go` (+6 -0) </details> ### 📄 Description As with `CreateQemuVm`, sometimes the `HandleTaskError` function panics on a nil deferencement error when the reponse or the body is nil. To avoid this, we only read/close the body when it is available, and fallback to a generic error string otherwise. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:41:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#335
No description provided.