read on closed response body error #551
Labels
No Label
has/backport
has/pull
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/go-sdk#551
Loading…
Reference in New Issue
Block a user
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?
I want to extract the body of the gitea.Response , however it appears closed
"read on closed response body error"
For example:
data, gitResp, err := client.MigrateRepo(opts)
Receive an 409 Conflict but was unable to get the message of why it failed
If i use the REST endpoints I get a response
Any insight on? Thanks
I changed the code on my local and able to get the error cause ... rather than the "conflict"
The
resp.body
has been consumed in internal. Should we expose that?two choices (imho)
if you provide a http.Response then the caller assumes they also have the resp.body. so it should be exposed
the other alternative not provide the http.Response ( sdk has abstracted that away ). so now the caller is only provided the data and error
for example:
data, err := client.MigrateRepo(opts)
I like the first one.