From 717ce576dd23041fd2fe00956c3c47092315e304 Mon Sep 17 00:00:00 2001 From: Daniel Bell Date: Tue, 17 Oct 2023 14:02:28 +0200 Subject: [PATCH] Use .rethrow --- .../nexus/delta/sdk/resources/ValidateResource.scala | 2 +- .../bluebrain/nexus/delta/sourcing/EphemeralDefinition.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala index 23aaf0011e..bce99cee46 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala @@ -116,7 +116,7 @@ object ValidateResource { validateShapes = false ).toCatsIOEither .map(_.leftMap(ResourceShaclEngineRejection(resourceId, schemaRef, _))) - .flatMap(IO.fromEither) + .rethrow } private def assertNotDeprecated(schema: ResourceF[Schema]) = { diff --git a/delta/sourcing-psql/src/main/scala/ch/epfl/bluebrain/nexus/delta/sourcing/EphemeralDefinition.scala b/delta/sourcing-psql/src/main/scala/ch/epfl/bluebrain/nexus/delta/sourcing/EphemeralDefinition.scala index 48b80b0289..893bfa2035 100644 --- a/delta/sourcing-psql/src/main/scala/ch/epfl/bluebrain/nexus/delta/sourcing/EphemeralDefinition.scala +++ b/delta/sourcing-psql/src/main/scala/ch/epfl/bluebrain/nexus/delta/sourcing/EphemeralDefinition.scala @@ -1,6 +1,7 @@ package ch.epfl.bluebrain.nexus.delta.sourcing import cats.effect.IO +import cats.implicits.catsSyntaxMonadErrorRethrow import ch.epfl.bluebrain.nexus.delta.sourcing.EvaluationError.EvaluationTimeout import ch.epfl.bluebrain.nexus.delta.sourcing.execution.EvaluationExecution import ch.epfl.bluebrain.nexus.delta.sourcing.model.EntityType @@ -25,6 +26,5 @@ final case class EphemeralDefinition[Id, S <: EphemeralState, Command, +R <: Rej execution.timer, execution.contextShift ) - .flatMap(IO.fromEither) - + .rethrow }