Improve warning and debug output in plugin

This commit is contained in:
Lucien Greathouse
2021-11-20 17:05:45 -05:00
parent e136529ff0
commit 173dc12cb3
2 changed files with 7 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ local function applyPatch(instanceMap, patch)
local failedToReify = reify(instanceMap, patch.added, id, parentInstance) local failedToReify = reify(instanceMap, patch.added, id, parentInstance)
if not PatchSet.isEmpty(failedToReify) then if not PatchSet.isEmpty(failedToReify) then
Log.debug("Failed to reify as part of applying a patch: {}", failedToReify) Log.debug("Failed to reify as part of applying a patch: {:#?}", failedToReify)
PatchSet.assign(unappliedPatch, failedToReify) PatchSet.assign(unappliedPatch, failedToReify)
end end
end end

View File

@@ -75,9 +75,13 @@ local function diff(instanceMap, virtualInstances, rootId)
changedProperties[propertyName] = virtualValue changedProperties[propertyName] = virtualValue
end end
else else
-- virtualValue can be empty in certain cases, and this may print out nil to the user.
local propertyType = next(virtualValue) local propertyType = next(virtualValue)
Log.warn("Failed to decode property of type {}", propertyType) Log.warn(
"Failed to decode property {}.{}. Encoded property was: {:#?}",
virtualInstance.ClassName,
propertyName,
virtualValue
)
end end
else else
local err = existingValueOrErr local err = existingValueOrErr