diff --git a/Core/Registry/AvailableModule.cs b/Core/Registry/AvailableModule.cs index 66ffaa88d1..27b8aea111 100644 --- a/Core/Registry/AvailableModule.cs +++ b/Core/Registry/AvailableModule.cs @@ -9,6 +9,7 @@ using CKAN.Versioning; using log4net; using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; namespace CKAN { @@ -51,6 +52,14 @@ public AvailableModule(string identifier) internal SortedDictionary module_version = new SortedDictionary(); + [OnError] + private void OnError(StreamingContext context, ErrorContext errorContext) + { + log.WarnFormat("Discarding CkanModule, failed to parse {0}: {1}", + errorContext.Path, errorContext.Error.GetBaseException().Message); + errorContext.Handled = true; + } + /// /// Record the given module version as being available. ///