diff options
Diffstat (limited to 'routers/api/v1/repo/avatar.go')
-rw-r--r-- | routers/api/v1/repo/avatar.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/repo/avatar.go b/routers/api/v1/repo/avatar.go index 698337ffd2..593460586f 100644 --- a/routers/api/v1/repo/avatar.go +++ b/routers/api/v1/repo/avatar.go @@ -44,13 +44,13 @@ func UpdateAvatar(ctx *context.APIContext) { content, err := base64.StdEncoding.DecodeString(form.Image) if err != nil { - ctx.Error(http.StatusBadRequest, "DecodeImage", err) + ctx.APIError(http.StatusBadRequest, err) return } err = repo_service.UploadAvatar(ctx, ctx.Repo.Repository, content) if err != nil { - ctx.Error(http.StatusInternalServerError, "UploadAvatar", err) + ctx.APIErrorInternal(err) } ctx.Status(http.StatusNoContent) @@ -81,7 +81,7 @@ func DeleteAvatar(ctx *context.APIContext) { // "$ref": "#/responses/notFound" err := repo_service.DeleteAvatar(ctx, ctx.Repo.Repository) if err != nil { - ctx.Error(http.StatusInternalServerError, "DeleteAvatar", err) + ctx.APIErrorInternal(err) } ctx.Status(http.StatusNoContent) |