Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Error dont return html #14440

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

6543
Copy link
Member

@6543 6543 commented Jan 23, 2021

regression of #11355

Explanation:
ctx.ServerError() was not overloaded by APIContext so it would respond with an html error page instead of json :/

in the past I rewrote it with ctx.Error() or ctx.InternalServerError() but this issue is so common that it's better to overload this function instead

@6543 6543 added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jan 23, 2021
@6543 6543 added this to the 1.14.0 milestone Jan 23, 2021
@6543
Copy link
Member Author

6543 commented Jan 23, 2021

@a1012112796 ping ;)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 23, 2021
@6543 6543 added the modifies/api This PR adds API routes or modifies them label Jan 23, 2021
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 23, 2021
@codecov-io
Copy link

Codecov Report

Merging #14440 (8dc76bd) into master (525d75c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14440      +/-   ##
==========================================
- Coverage   41.76%   41.76%   -0.01%     
==========================================
  Files         748      748              
  Lines       80103    80105       +2     
==========================================
- Hits        33455    33454       -1     
- Misses      41125    41130       +5     
+ Partials     5523     5521       -2     
Impacted Files Coverage Δ
modules/context/api.go 69.07% <0.00%> (-0.93%) ⬇️
models/unit.go 46.57% <0.00%> (-2.74%) ⬇️
routers/repo/view.go 40.95% <0.00%> (-0.63%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
services/pull/pull.go 42.15% <0.00%> (-0.50%) ⬇️
modules/process/manager.go 75.00% <0.00%> (+2.50%) ⬆️
modules/charset/charset.go 73.03% <0.00%> (+4.49%) ⬆️
modules/util/timer.go 85.71% <0.00%> (+42.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 800c436...8dc76bd. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 23, 2021
@lafriks lafriks merged commit 4acb499 into go-gitea:master Jan 23, 2021
@lafriks lafriks deleted the api-fix-err-msg-return branch January 23, 2021 19:33
a1012112796 added a commit to a1012112796/gitea that referenced this pull request Jan 25, 2021
* master: (358 commits)
  [skip ci] Updated translations via Crowdin
  Use caddy's certmagic library for extensible/robust ACME handling (go-gitea#14177)
  Redirect on changed user and org name (go-gitea#11649)
  chore: bump minio to RELEASE.2021-01-16T02-19-44Z (go-gitea#14445)
  [skip ci] Updated translations via Crowdin
  CI: skip build steps for cron update works (go-gitea#14443)
  [skip ci] Updated licenses and gitignores
  [skip ci] Updated translations via Crowdin
  just overload to not get it by mistake again ... (go-gitea#14440)
  [skip ci] Updated translations via Crowdin
  Add link to packages in openSUSE build service (go-gitea#14439)
  Improve Description in new/ edit Project template (go-gitea#14429)
  Don't show "Reference in new issue" when issues unit is globally disabled (go-gitea#14437)
  CI: Update license & gitignore by cron (go-gitea#14419)
  Fix close/reopen with comment (go-gitea#14436)
  Add german translation guidelines (go-gitea#14283)
  [skip ci] Updated translations via Crowdin
  Fix lfs preview bug (go-gitea#14428)
  [skip ci] Updated translations via Crowdin
  Bump gsap from 3.5.1 to 3.6.0 (go-gitea#14410)
  ...
a1012112796 added a commit to a1012112796/gitea that referenced this pull request Jan 25, 2021
* master: (542 commits)
  [skip ci] Updated translations via Crowdin
  Use caddy's certmagic library for extensible/robust ACME handling (go-gitea#14177)
  Redirect on changed user and org name (go-gitea#11649)
  chore: bump minio to RELEASE.2021-01-16T02-19-44Z (go-gitea#14445)
  [skip ci] Updated translations via Crowdin
  CI: skip build steps for cron update works (go-gitea#14443)
  [skip ci] Updated licenses and gitignores
  [skip ci] Updated translations via Crowdin
  just overload to not get it by mistake again ... (go-gitea#14440)
  [skip ci] Updated translations via Crowdin
  Add link to packages in openSUSE build service (go-gitea#14439)
  Improve Description in new/ edit Project template (go-gitea#14429)
  Don't show "Reference in new issue" when issues unit is globally disabled (go-gitea#14437)
  CI: Update license & gitignore by cron (go-gitea#14419)
  Fix close/reopen with comment (go-gitea#14436)
  Add german translation guidelines (go-gitea#14283)
  [skip ci] Updated translations via Crowdin
  Fix lfs preview bug (go-gitea#14428)
  [skip ci] Updated translations via Crowdin
  Bump gsap from 3.5.1 to 3.6.0 (go-gitea#14410)
  ...
@go-gitea go-gitea locked and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants