public ISnapshotWriter CreateWriter(string potName) { PotDirectory potDirectory = PotDirectory.FromPotName(potName); if (!potDirectory.IsValid) { throw new Exception($"There is no pot with name '{potName}'."); } SnapshotFile snapshotFile = potDirectory.CreateSnapshotFile(DateTime.UtcNow); JSnapshotWriter jSnapshotWriter = snapshotFile.OpenWriter(); return(new JsonSnapshotWriter(jSnapshotWriter)); }