WIP feat: return response on functions #361
No reviewers
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#361
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ankitm123/go-sdk:sdk-347"
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?
This PR:
Fixes #347
aa263f0475
toeb986ba05f
@ankitm123 you dont need to squash, its easyer to review diffs per commit - and thans for your work
@ -111,3 +117,3 @@
return nil, nil, err
}
switch resp.StatusCode {
I know this is stil WIP ...
... but I wont remove status check on the client
and on function witch use e.g. getResponse
dont
return nil, nil, err
->return nil, resp, err
and it should work all fineI think the burden of checking the response status code should be with the end user, but I can return the textual representation of some of the status code (the ones in that status check), thoughts?
I think the client should check if there was an error - since http status codes represent them
if remove this a lot of code is not gone just the user has to reimplement it elsewhere
and it is harder to use
I agree for 5XXs, yes, but not so sure about 4XXs (There can be cases where 4XXs are not considered errors)
thats why we will return responce too so the user still can deside what to do with it
The idiomatic way to do error checks in go, would mean that if it's an error, then people wont get it to the check for response, right?
So an error for 4XXs will make it a bit complicated imo.
If i like to get something and it return 404 its not what i wont -> error
If the user like to know that he can still check the status with this pull
@ankitm123 what's the matter?
Pull request closed