treewide: DeleteFailReason as an object with translated details

This commit is contained in:
Yousong Zhou
2020-09-07 18:51:29 +08:00
parent 776ef9b8b5
commit 6415de33d3
3 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -778,7 +778,7 @@ func getModelExtraDetails(item IModel, ctx context.Context, showReason bool) api
if err != nil {
out.CanDelete = false
if showReason {
out.DeleteFailReason = err.Error()
out.DeleteFailReason = httperrors.NewErrorFromGeneralError(ctx, err)
}
}
err = item.ValidateUpdateCondition(ctx)