diff --git a/CHANGELOG.md b/CHANGELOG.md index e231d43..106bde6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # CHANGELOG +## 1.13.3 + +* fix: rethrow our exceptions in `writeTargetProperty`, fix confusing error + message + ## 1.13.2 * feat: `Map` now accepts false, for the more expressive `#[Map(false)]` diff --git a/src/Transformer/Processor/ObjectProcessor/ObjectProcessor.php b/src/Transformer/Processor/ObjectProcessor/ObjectProcessor.php index 2f8e5e2..950eed9 100644 --- a/src/Transformer/Processor/ObjectProcessor/ObjectProcessor.php +++ b/src/Transformer/Processor/ObjectProcessor/ObjectProcessor.php @@ -18,6 +18,7 @@ use Rekalogika\Mapper\Context\Context; use Rekalogika\Mapper\Context\ExtraTargetValues; use Rekalogika\Mapper\Context\MapperOptions; +use Rekalogika\Mapper\Exception\ExceptionInterface; use Rekalogika\Mapper\Exception\UnexpectedValueException; use Rekalogika\Mapper\MainTransformer\MainTransformerInterface; use Rekalogika\Mapper\ObjectCache\ObjectCache; @@ -1054,6 +1055,8 @@ public function writeTargetProperty( } } catch (\BadMethodCallException) { return $target; + } catch (ExceptionInterface $e) { + throw $e; } catch (\Throwable $e) { throw new UnableToWriteException( target: $target,