Skip to content

Fix bug when gitea request fails#2806

Merged
olblak merged 1 commit intoupdatecli:mainfrom
btrepp:fix/gitea-null
Oct 12, 2024
Merged

Fix bug when gitea request fails#2806
olblak merged 1 commit intoupdatecli:mainfrom
btrepp:fix/gitea-null

Conversation

@btrepp
Copy link
Copy Markdown
Contributor

@btrepp btrepp commented Oct 12, 2024

fix #2802

Trying to print out the http status codes
results in a deferencing null when they are not
set. Thus crashing the cmd in case of an error.

As we don't know the error, it's best to just
print the error here.

Tradeoff

There may be cases in which the body is helpful to have, however that would need to be checked.
I think further down other cases handle HTTP codes so I don't think information is lost

Trying to print out the http status codes
results in a deferencing null when they are not
set. Thus crashing the cmd in case of an error.

As we don't know the error, it's best to just
print the error here.
@olblak
Copy link
Copy Markdown
Member

olblak commented Oct 12, 2024

Thanks for the pullrequest, the go-scm library used in this project is a generic one that support different git provider but not all of them return error message via http request so it makes sense to ignore the request body in this case

@olblak olblak added scm-gittea bug Something isn't working labels Oct 12, 2024
@olblak olblak enabled auto-merge (squash) October 12, 2024 18:47
@olblak olblak merged commit 7c94d2b into updatecli:main Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working scm-gittea

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sigsev with forgejo and oauth2 token

2 participants