Refactor error system (#33610)
This commit is contained in:
@@ -42,7 +42,7 @@ type blameRow struct {
|
||||
func RefBlame(ctx *context.Context) {
|
||||
fileName := ctx.Repo.TreePath
|
||||
if len(fileName) == 0 {
|
||||
ctx.NotFound("Blame FileName", nil)
|
||||
ctx.NotFound(nil)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ func RefBlame(ctx *context.Context) {
|
||||
|
||||
ctx.Data["NumLines"], err = blob.GetBlobLineCount()
|
||||
if err != nil {
|
||||
ctx.NotFound("GetBlobLineCount", err)
|
||||
ctx.NotFound(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ func RefBlame(ctx *context.Context) {
|
||||
|
||||
result, err := performBlame(ctx, ctx.Repo.Repository.RepoPath(), ctx.Repo.Commit, fileName, bypassBlameIgnore)
|
||||
if err != nil {
|
||||
ctx.NotFound("CreateBlameReader", err)
|
||||
ctx.NotFound(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ func processBlameParts(ctx *context.Context, blameParts []*git.BlamePart) map[st
|
||||
commit, err = ctx.Repo.GitRepo.GetCommit(sha)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
ctx.NotFound("Repo.GitRepo.GetCommit", err)
|
||||
ctx.NotFound(err)
|
||||
} else {
|
||||
ctx.ServerError("Repo.GitRepo.GetCommit", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user