no longer completely fail on one wrong entry

U17 might have caused some journal bugs so don't fail immediately on one wrong entry, instead keep them in an Errors collection for later processing
This commit is contained in:
2023-10-25 11:30:34 +02:00
parent acb60e0a08
commit d6842115c5
4 changed files with 30 additions and 5 deletions

View File

@@ -64,7 +64,15 @@ public class Entry {
public static Entry? Parse(string journalline) {
using (JsonReader reader = new JsonTextReader(new StringReader(journalline))) {
reader.DateParseHandling = DateParseHandling.None;
var json = JObject.Load(reader);
JObject? json = null;
try {
json = JObject.Load(reader);
} catch (Exception e) {
throw new InvalidJournalEntryException(
"invalid JSON journal entry: " + journalline,
e
);
}
if (json == null) {
return null;
}