diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-16 01:22:27 +0800 |
---|---|---|
committer | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-16 01:22:27 +0800 |
commit | 9e9ca66467116e9079a2639c00e9e623aca23015 (patch) | |
tree | dacdef5392608ff7107e4dd498959d4899e13e54 /internal/route/api/v1/user/user.go | |
parent | 82ff0c5852f29daa5f95d965fd50665581e7ea3c (diff) |
refactor: unify error handling in routing layer
Diffstat (limited to 'internal/route/api/v1/user/user.go')
-rw-r--r-- | internal/route/api/v1/user/user.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/internal/route/api/v1/user/user.go b/internal/route/api/v1/user/user.go index 8da3b734..695d5311 100644 --- a/internal/route/api/v1/user/user.go +++ b/internal/route/api/v1/user/user.go @@ -13,7 +13,6 @@ import ( "gogs.io/gogs/internal/context" "gogs.io/gogs/internal/db" - "gogs.io/gogs/internal/db/errors" "gogs.io/gogs/internal/markup" ) @@ -58,7 +57,7 @@ func Search(c *context.APIContext) { func GetInfo(c *context.APIContext) { u, err := db.GetUserByName(c.Params(":username")) if err != nil { - c.NotFoundOrServerError("GetUserByName", errors.IsUserNotExist, err) + c.NotFoundOrError(err, "get user by name") return } |