[PR #22] [MERGED] Return errors from ResponseJSON #159

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

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/22
Author: @carlpett
Created: 3/16/2019
Status: Merged
Merged: 4/10/2019
Merged by: @ggongaware

Base: masterHead: return-request-errors


📝 Commits (1)

  • 4229ea9 Return errors from ResponseJSON

📊 Changes

2 files changed (+66 additions, -37 deletions)

View changed files

📝 proxmox/client.go (+44 -21)
📝 proxmox/session.go (+22 -16)

📄 Description

This PR changes ResponseJSON to return errors, instead of dropping them, which caused me a bit of confusion during development.

It also returns the response from session.Do even if the response code is not 2xx, since the response body usually contains the actual error.


🔄 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/22 **Author:** [@carlpett](https://github.com/carlpett) **Created:** 3/16/2019 **Status:** ✅ Merged **Merged:** 4/10/2019 **Merged by:** [@ggongaware](https://github.com/ggongaware) **Base:** `master` ← **Head:** `return-request-errors` --- ### 📝 Commits (1) - [`4229ea9`](https://github.com/Telmate/proxmox-api-go/commit/4229ea9689d259be4ef8c0ad9f5b0aa43774f95b) Return errors from ResponseJSON ### 📊 Changes **2 files changed** (+66 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/client.go` (+44 -21) 📝 `proxmox/session.go` (+22 -16) </details> ### 📄 Description This PR changes `ResponseJSON` to return errors, instead of dropping them, which caused me a bit of confusion during development. It also returns the response from `session.Do` even if the response code is not 2xx, since the response body usually contains the actual error. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:40:54 +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#159
No description provided.