aboutsummaryrefslogtreecommitdiff
path: root/routes/api/v1/user/user.go
diff options
context:
space:
mode:
authorunknwon <u@gogs.io>2019-08-10 13:40:48 -0700
committerunknwon <u@gogs.io>2019-08-10 13:40:48 -0700
commitf1e0ebfe937213be2af4a3180fae9f43949de00e (patch)
tree3b462bd02b3c5d28099ca5e47e21370d8c02688a /routes/api/v1/user/user.go
parentc7ba519af2f2d8e79077d2776cb34f8b61556471 (diff)
routes/api/v1: codemod
Diffstat (limited to 'routes/api/v1/user/user.go')
-rw-r--r--routes/api/v1/user/user.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/routes/api/v1/user/user.go b/routes/api/v1/user/user.go
index 9a5cbb5c..70897166 100644
--- a/routes/api/v1/user/user.go
+++ b/routes/api/v1/user/user.go
@@ -58,11 +58,7 @@ func Search(c *context.APIContext) {
func GetInfo(c *context.APIContext) {
u, err := models.GetUserByName(c.Params(":username"))
if err != nil {
- if errors.IsUserNotExist(err) {
- c.NotFound()
- } else {
- c.ServerError("GetUserByName", err)
- }
+ c.NotFoundOrServerError("GetUserByName", errors.IsUserNotExist, err)
return
}