Add missed return after ctx.ServerError (#31130) (partial)

Only routers/api/v1/repo/mirror.go

(cherry picked from commit b6f15c7948ac3d09977350de83ec91d5789ea083)
This commit is contained in:
Lunny Xiao 2024-05-28 17:31:59 +08:00 committed by Earl Warren
parent 16e8dfe417
commit ba37b9e577
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -383,6 +383,7 @@ func CreatePushMirror(ctx *context.APIContext, mirrorOption *api.CreatePushMirro
if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil { if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil {
if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil { if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil {
ctx.ServerError("DeletePushMirrors", err) ctx.ServerError("DeletePushMirrors", err)
return
} }
ctx.ServerError("AddPushMirrorRemote", err) ctx.ServerError("AddPushMirrorRemote", err)
return return