Improve user error handling.

This commit is contained in:
Gucheng Wang
2021-12-12 19:59:55 +08:00
parent 96e2f286ee
commit f4265d015a
5 changed files with 16 additions and 5 deletions

View File

@ -228,7 +228,7 @@ func (c *ApiController) SetPassword() {
userId := fmt.Sprintf("%s/%s", userOwner, userName)
targetUser := object.GetUser(userId)
if targetUser == nil {
c.ResponseError("Invalid user id.")
c.ResponseError(fmt.Sprintf("The user: %s doesn't exist", userId))
return
}