diff options
Diffstat (limited to 'routers/api/v1/repo/file.go')
-rw-r--r-- | routers/api/v1/repo/file.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 762a0f25d9..929ed00d68 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -40,14 +40,14 @@ func GetRawFile(ctx *context.APIContext) { // 200: // description: success if ctx.Repo.Repository.IsEmpty { - ctx.Status(404) + ctx.NotFound() return } blob, err := ctx.Repo.Commit.GetBlobByPath(ctx.Repo.TreePath) if err != nil { if git.IsErrNotExist(err) { - ctx.Status(404) + ctx.NotFound() } else { ctx.Error(500, "GetBlobByPath", err) } @@ -124,7 +124,7 @@ func GetEditorconfig(ctx *context.APIContext) { ec, err := ctx.Repo.GetEditorconfig() if err != nil { if git.IsErrNotExist(err) { - ctx.Error(404, "GetEditorconfig", err) + ctx.NotFound(err) } else { ctx.Error(500, "GetEditorconfig", err) } @@ -134,7 +134,7 @@ func GetEditorconfig(ctx *context.APIContext) { fileName := ctx.Params("filename") def := ec.GetDefinitionForFilename(fileName) if def == nil { - ctx.Error(404, "GetDefinitionForFilename", err) + ctx.NotFound(err) return } ctx.JSON(200, def) |