mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: send full reason body for *_fail_reason
This commit is contained in:
@@ -670,14 +670,14 @@ func getModelExtraDetails(item IModel, ctx context.Context, extra *jsonutils.JSO
|
||||
err := item.ValidateDeleteCondition(ctx)
|
||||
if err != nil {
|
||||
extra.Add(jsonutils.JSONFalse, "can_delete")
|
||||
extra.Add(jsonutils.NewString(httputils.ErrorMsg(err)), "delete_fail_reason")
|
||||
extra.Add(jsonutils.NewString(err.Error()), "delete_fail_reason")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONTrue, "can_delete")
|
||||
}
|
||||
err = item.ValidateUpdateCondition(ctx)
|
||||
if err != nil {
|
||||
extra.Add(jsonutils.JSONFalse, "can_update")
|
||||
extra.Add(jsonutils.NewString(httputils.ErrorMsg(err)), "update_fail_reason")
|
||||
extra.Add(jsonutils.NewString(err.Error()), "update_fail_reason")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONTrue, "can_update")
|
||||
}
|
||||
|
||||
@@ -2338,7 +2338,7 @@ func (self *SHost) getMoreDetails(ctx context.Context, extra *jsonutils.JSONDict
|
||||
extra.Add(jsonutils.JSONTrue, "can_prepare")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONFalse, "can_prepare")
|
||||
extra.Add(jsonutils.NewString(httputils.ErrorMsg(err)), "prepare_fail_reason")
|
||||
extra.Add(jsonutils.NewString(err.Error()), "prepare_fail_reason")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user