1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 15:10:49 +00:00

Fix no error message issue

This commit is contained in:
Haibin Liu 2015-09-28 07:42:11 +08:00
parent d70592fd14
commit 5c6eeae33a

View File

@ -323,7 +323,7 @@ func (o *ObjectController) Get() {
if objectId != "" {
ob, err := models.GetOne(objectId)
if err != nil {
o.Data["json"] = err
o.Data["json"] = err.Error()
} else {
o.Data["json"] = ob
}
@ -356,7 +356,7 @@ func (o *ObjectController) Put() {
err := models.Update(objectId, ob.Score)
if err != nil {
o.Data["json"] = err
o.Data["json"] = err.Error()
} else {
o.Data["json"] = "update success!"
}
@ -426,7 +426,7 @@ func (u *UserController) Get() {
if uid != "" {
user, err := models.GetUser(uid)
if err != nil {
u.Data["json"] = err
u.Data["json"] = err.Error()
} else {
u.Data["json"] = user
}
@ -448,7 +448,7 @@ func (u *UserController) Put() {
json.Unmarshal(u.Ctx.Input.RequestBody, &user)
uu, err := models.UpdateUser(uid, &user)
if err != nil {
u.Data["json"] = err
u.Data["json"] = err.Error()
} else {
u.Data["json"] = uu
}