log setting invalid chapter node properties

pull/8091/head
Thibault Duplessis 2021-02-03 08:59:16 +01:00
parent 697f1f3044
commit 09f1eef283
1 changed files with 9 additions and 2 deletions

View File

@ -158,9 +158,16 @@ final class ChapterRepo(val coll: AsyncColl)(implicit
value: Option[A]
)(chapter: Chapter, path: Path): Funit =
coll {
_.updateOrUnsetField($id(chapter.id), pathToField(path, field), value)
_.updateOrUnsetField(
$id(chapter.id) ++ $doc(path.toDbField $exists true),
pathToField(path, field),
value
)
.addEffect {
case 0 => logger.warn(s"Can't setNodeValue ${chapter.id} $path $field, no node matched!")
case 0 =>
logger.warn(
s"Can't setNodeValue ${chapter.id} '$path' $field '${path.toDbField}' / no node matched!"
)
case _ =>
}
}.void