[API] Deleting an unexisting repo returns undocumented response #2913

Closed
opened 2025-11-02 04:53:44 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @bogdanpetrea on GitHub (Feb 14, 2019).

  • Gitea version (or commit ref): 7a72aa6
  • Git version: whatever is on try.gitea.io
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes, actually the only place I tried

Description

When trying to delete a repository that doesn't exist, the API returns an undocumented error code (prob 500) and an error message, when it could just as well return a successful response.

Tested via Swagger:

curl -X DELETE "http://try.gitea.io/api/v1/repos/bogdan/doesntexist" -H  "accept: application/json"
Code Details
Undocumented TypeError: NetworkError when attempting to fetch resource.

This might also apply to other resources.

Originally created by @bogdanpetrea on GitHub (Feb 14, 2019). - Gitea version (or commit ref): 7a72aa6 - Git version: whatever is on try.gitea.io - Can you reproduce the bug at https://try.gitea.io: - [x] Yes, actually the only place I tried ## Description When trying to delete a repository that doesn't exist, the API returns an undocumented error code (prob 500) and an error message, when [it could just as well return a successful response](https://stackoverflow.com/questions/6439416/deleting-a-resource-using-http-delete#comment33002038_6440374). Tested via [Swagger](https://try.gitea.io/api/swagger#/repository/repoDelete): ```sh curl -X DELETE "http://try.gitea.io/api/v1/repos/bogdan/doesntexist" -H "accept: application/json" ``` Code | Details -- | -- Undocumented | TypeError: NetworkError when attempting to fetch resource. This might also apply to other resources.
GiteaMirror added the type/bug label 2025-11-02 04:53:44 -06:00
Author
Owner

@lafriks commented on GitHub (Feb 14, 2019):

It should return 404 imho

@lafriks commented on GitHub (Feb 14, 2019): It should return 404 imho
Author
Owner

@bogdanpetrea commented on GitHub (Feb 21, 2019):

After checking again on a local instance it seems 404 is indeed returned, but there's a problem with https://try.gitea.io's Swagger. I get the NetworkError for everything I try.

@bogdanpetrea commented on GitHub (Feb 21, 2019): After checking again on a local instance it seems 404 is indeed returned, but there's a problem with [https://try.gitea.io](try.gitea.io)'s Swagger. I get the `NetworkError` for everything I try.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2913