Return Reponse on functions too #347
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#347
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?
The function signature of getResponse should be changed to return the response code explicitely. Presently, it returns it inside the error message, and the end user has to parse the error to find the response code. It would be user friendly to change the signature to this:
I can work on a PR, if it is ok. For example, github and bitbucket return it separately.
this will close #303
if no error ocure - the expected status is recived, I think we dont need to return the status code.
But for error responce we should, so I think this is a dublicate of #303 and refactor
func getResponse()
is one of the results of it ...@ankitm123 did I missed something?
In that case, should it not return
data,<*response>, nil
? (Better to return the pointer to the response object, and let the end user work with it?). This also brings consisteny with other git providers, wdyt?I dont think error should contain the response/status code. A separate response struct would make the code simpler imo. So something like this:
thoughts?
I would then make it similar to https://github.com/google/go-github/blob/master/github/github.go#L405
@ankitm123 if you like
Return reponse code separately for getresponse functionto Return Reponse on functionsReturn Reponse on functionsto Return Reponse on functions too@ankitm123 what's the current status?
I have time this week to focus on this issue, should be done by the End of Week.
While going through the codebase, I came across
getStatusCode
function, which I think can be removed after this change. Thoughts?May be it should be done in a separate isse, and not this?
No go on with remove it