Updated Syncer
Added more error catching when processing in sync data.
This commit is contained in:
parent
ad155026d1
commit
789ceeedff
1 changed files with 12 additions and 3 deletions
|
|
@ -164,9 +164,18 @@ public class Syncer<T> : ISyncer where T : class, IDataModel, new()
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
var jobj = JsonSerializer.Deserialize<JsonObject>(entryObject, GlobalJsonOptions.Options);
|
||||
entry = new T();
|
||||
entry.MarshalData(jobj["_id"].GetValue<string>(), entryObject);
|
||||
try
|
||||
{
|
||||
var jobj = JsonSerializer.Deserialize<JsonObject>(entryObject, GlobalJsonOptions.Options);
|
||||
entry = new T();
|
||||
entry.MarshalData(jobj["_id"].GetValue<string>(), entryObject);
|
||||
}
|
||||
catch (Exception iex)
|
||||
{
|
||||
// TODO: Replace with Logger
|
||||
Console.WriteLine($"Failed to parse line: {entryObject}\nMessage: {iex.Message}");
|
||||
entry = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (entry == null) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue