mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Refactor error system (#33610)
This commit is contained in:
@@ -23,7 +23,7 @@ func AddDependency(ctx *context.Context) {
|
||||
|
||||
// Check if the Repo is allowed to have dependencies
|
||||
if !ctx.Repo.CanCreateIssueDependencies(ctx, ctx.Doer, issue.IsPull) {
|
||||
ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies")
|
||||
ctx.HTTPError(http.StatusForbidden, "CanCreateIssueDependencies")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ func RemoveDependency(ctx *context.Context) {
|
||||
|
||||
// Check if the Repo is allowed to have dependencies
|
||||
if !ctx.Repo.CanCreateIssueDependencies(ctx, ctx.Doer, issue.IsPull) {
|
||||
ctx.Error(http.StatusForbidden, "CanCreateIssueDependencies")
|
||||
ctx.HTTPError(http.StatusForbidden, "CanCreateIssueDependencies")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ func RemoveDependency(ctx *context.Context) {
|
||||
case "blocking":
|
||||
depType = issues_model.DependencyTypeBlocking
|
||||
default:
|
||||
ctx.Error(http.StatusBadRequest, "GetDependecyType")
|
||||
ctx.HTTPError(http.StatusBadRequest, "GetDependecyType")
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user