diff --git a/ChronoJsonDiffPatch/ChronoJsonDiffPatch/PatchingException.cs b/ChronoJsonDiffPatch/ChronoJsonDiffPatch/PatchingException.cs index 063dac7..991a715 100644 --- a/ChronoJsonDiffPatch/ChronoJsonDiffPatch/PatchingException.cs +++ b/ChronoJsonDiffPatch/ChronoJsonDiffPatch/PatchingException.cs @@ -18,7 +18,7 @@ public class PatchingException : Exception /// /// state of the entity at the point where Applying failed /// - public JToken StateOfEntityBeforePatch { get; } + public TEntity StateOfEntityBeforePatch { get; } /// /// patch that could not be applied @@ -41,7 +41,7 @@ public class PatchingException : Exception /// public PatchingException( TEntity stateOfEntityBeforeAnyPatch, - JToken left, + TEntity left, JToken? patch, int index, string message, diff --git a/ChronoJsonDiffPatch/ChronoJsonDiffPatch/TimeRangePatchChain.cs b/ChronoJsonDiffPatch/ChronoJsonDiffPatch/TimeRangePatchChain.cs index 89404bd..736291b 100644 --- a/ChronoJsonDiffPatch/ChronoJsonDiffPatch/TimeRangePatchChain.cs +++ b/ChronoJsonDiffPatch/ChronoJsonDiffPatch/TimeRangePatchChain.cs @@ -599,7 +599,7 @@ var existingPatch in GetAll() throw new PatchingException( stateOfEntityBeforeAnyPatch: initialEntity, - left: left, + left: entityBeforePatch, patch: jtokenPatch, index: index, message: $"Failed to apply patches ({PatchingDirection}): {exc.Message}; None of the {_skipConditions?.Count() ?? 0} skip conditions applied", @@ -645,7 +645,7 @@ var existingPatch in GetAll() throw new PatchingException( stateOfEntityBeforeAnyPatch: initialEntity, - left: left, + left: entityBeforePatch, patch: jtokenPatch, index: index, message: $"Failed to apply patches ({PatchingDirection}): {exc.Message}; None of the {_skipConditions?.Count() ?? 0} skip conditions applied",