fix: improve error messages

This commit is contained in:
Gucheng Wang
2022-03-07 15:15:59 +08:00
parent 8a9cc2eb8f
commit 3602d9b9a7
4 changed files with 9 additions and 9 deletions

View File

@ -16,6 +16,7 @@ package controllers
import (
"encoding/json"
"fmt"
"github.com/astaxie/beego/utils/pagination"
"github.com/casdoor/casdoor/object"
@ -85,7 +86,7 @@ func (c *ApiController) GetUserApplication() {
id := c.Input().Get("id")
user := object.GetUser(id)
if user == nil {
c.ResponseError("No such user.")
c.ResponseError(fmt.Sprintf("The user: %s doesn't exist", id))
return
}