diff options
Diffstat (limited to 'routers/api/v1/repo/tree.go')
-rw-r--r-- | routers/api/v1/repo/tree.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/repo/tree.go b/routers/api/v1/repo/tree.go index 768e5d41c1..dfd69600fb 100644 --- a/routers/api/v1/repo/tree.go +++ b/routers/api/v1/repo/tree.go @@ -58,11 +58,11 @@ func GetTree(ctx *context.APIContext) { sha := ctx.PathParam("sha") if len(sha) == 0 { - ctx.Error(http.StatusBadRequest, "", "sha not provided") + ctx.APIError(http.StatusBadRequest, "sha not provided") return } if tree, err := files_service.GetTreeBySHA(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, sha, ctx.FormInt("page"), ctx.FormInt("per_page"), ctx.FormBool("recursive")); err != nil { - ctx.Error(http.StatusBadRequest, "", err.Error()) + ctx.APIError(http.StatusBadRequest, err.Error()) } else { ctx.SetTotalCountHeader(int64(tree.TotalCount)) ctx.JSON(http.StatusOK, tree) |