From 1c0d87527bbcdaf067e796a5208f253014827ed3 Mon Sep 17 00:00:00 2001 From: eikek Date: Sat, 17 Jul 2021 14:52:46 +0200 Subject: [PATCH] Log error when setting folder doesn't work --- .../main/scala/docspell/joex/process/SetGivenData.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/joex/src/main/scala/docspell/joex/process/SetGivenData.scala b/modules/joex/src/main/scala/docspell/joex/process/SetGivenData.scala index 3618c3d7..53162af2 100644 --- a/modules/joex/src/main/scala/docspell/joex/process/SetGivenData.scala +++ b/modules/joex/src/main/scala/docspell/joex/process/SetGivenData.scala @@ -12,6 +12,7 @@ import cats.implicits._ import docspell.backend.ops.OItem import docspell.common._ import docspell.joex.scheduler.Task +import docspell.store.UpdateResult object SetGivenData { type Args = ProcessItemArgs @@ -46,7 +47,12 @@ object SetGivenData { e <- ops.setFolder(itemId, folderId, collective).attempt _ <- e.fold( ex => ctx.logger.warn(s"Error setting folder: ${ex.getMessage}"), - _ => ().pure[F] + res => + res match { + case UpdateResult.Failure(ex) => + ctx.logger.warn(s"Error setting folder: ${ex.getMessage}") + case _ => ().pure[F] + } ) } yield data }