aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/blob.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/blob.go')
-rw-r--r--routers/api/v1/repo/blob.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/blob.go b/routers/api/v1/repo/blob.go
index f38086954b..9a17fc1bbf 100644
--- a/routers/api/v1/repo/blob.go
+++ b/routers/api/v1/repo/blob.go
@@ -43,12 +43,12 @@ func GetBlob(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 blob, err := files_service.GetBlobBySHA(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, sha); err != nil {
- ctx.Error(http.StatusBadRequest, "", err)
+ if blob, err := files_service.GetBlobBySHA(ctx.Repo.Repository, ctx.Repo.GitRepo, sha); err != nil {
+ ctx.APIError(http.StatusBadRequest, err)
} else {
ctx.JSON(http.StatusOK, blob)
}