summaryrefslogtreecommitdiffstats
path: root/routers/user/profile.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r--routers/user/profile.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index 86819de251..d63f84afd3 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -29,9 +29,9 @@ func GetUserByName(ctx *context.Context, name string) *models.User {
user, err := models.GetUserByName(name)
if err != nil {
if models.IsErrUserNotExist(err) {
- ctx.Handle(404, "GetUserByName", nil)
+ ctx.NotFound("GetUserByName", nil)
} else {
- ctx.Handle(500, "GetUserByName", err)
+ ctx.ServerError("GetUserByName", err)
}
return nil
}
@@ -79,7 +79,7 @@ func Profile(ctx *context.Context) {
// Show OpenID URIs
openIDs, err := models.GetUserOpenIDs(ctxUser.ID)
if err != nil {
- ctx.Handle(500, "GetUserOpenIDs", err)
+ ctx.ServerError("GetUserOpenIDs", err)
return
}
@@ -91,7 +91,7 @@ func Profile(ctx *context.Context) {
orgs, err := models.GetOrgsByUserID(ctxUser.ID, showPrivate)
if err != nil {
- ctx.Handle(500, "GetOrgsByUserIDDesc", err)
+ ctx.ServerError("GetOrgsByUserIDDesc", err)
return
}
@@ -147,13 +147,13 @@ func Profile(ctx *context.Context) {
if len(keyword) == 0 {
repos, err = ctxUser.GetStarredRepos(showPrivate, page, setting.UI.User.RepoPagingNum, orderBy.String())
if err != nil {
- ctx.Handle(500, "GetStarredRepos", err)
+ ctx.ServerError("GetStarredRepos", err)
return
}
count, err = ctxUser.GetStarredRepoCount(showPrivate)
if err != nil {
- ctx.Handle(500, "GetStarredRepoCount", err)
+ ctx.ServerError("GetStarredRepoCount", err)
return
}
} else {
@@ -168,7 +168,7 @@ func Profile(ctx *context.Context) {
Collaborate: util.OptionalBoolFalse,
})
if err != nil {
- ctx.Handle(500, "SearchRepositoryByName", err)
+ ctx.ServerError("SearchRepositoryByName", err)
return
}
}
@@ -181,7 +181,7 @@ func Profile(ctx *context.Context) {
var total int
repos, err = models.GetUserRepositories(ctxUser.ID, showPrivate, page, setting.UI.User.RepoPagingNum, orderBy.String())
if err != nil {
- ctx.Handle(500, "GetRepositories", err)
+ ctx.ServerError("GetRepositories", err)
return
}
ctx.Data["Repos"] = repos
@@ -191,7 +191,7 @@ func Profile(ctx *context.Context) {
} else {
count, err := models.GetPublicRepositoryCount(ctxUser)
if err != nil {
- ctx.Handle(500, "GetPublicRepositoryCount", err)
+ ctx.ServerError("GetPublicRepositoryCount", err)
return
}
total = int(count)
@@ -210,7 +210,7 @@ func Profile(ctx *context.Context) {
PageSize: setting.UI.User.RepoPagingNum,
})
if err != nil {
- ctx.Handle(500, "SearchRepositoryByName", err)
+ ctx.ServerError("SearchRepositoryByName", err)
return
}
@@ -267,7 +267,7 @@ func Action(ctx *context.Context) {
}
if err != nil {
- ctx.Handle(500, fmt.Sprintf("Action (%s)", ctx.Params(":action")), err)
+ ctx.ServerError(fmt.Sprintf("Action (%s)", ctx.Params(":action")), err)
return
}